feat: integrate Umami analytics for screen tracking via GoRouter observers

This commit is contained in:
pradeepkumar
2026-04-21 11:58:03 +05:30
parent 3c61c25f5e
commit 09824fdd0d
5 changed files with 64 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
import 'package:flutter_estatisticas/umami_service.dart';
import 'package:flutter_estatisticas/umami_navigation_observer.dart';
/// Umami analytics singleton. Configured once at app startup.
///
/// Reuses the same `website` ID as the web app (re-quest.com) so all traffic
/// (web + mobile) aggregates under one dashboard. `hostname` differentiates
/// mobile vs. web inside Umami.
class UmamiAnalytics {
UmamiAnalytics._();
static const _endpoint = 'https://analytics.superlabs.co';
static const _websiteId = '00e1ce31-e174-4519-8b59-63e8d4556b01';
static const _hostname = 're-quest-mobile.app';
static final UmamiService service = UmamiService(
endpoint: _endpoint,
website: _websiteId,
hostname: _hostname,
);
/// Navigator observer that auto-tracks screen transitions in GoRouter.
static final UmamiNavigationObserver navigationObserver =
UmamiNavigationObserver(service);
}