[READ ONLY MIRROR] Open Source TikTok alternative built on AT Protocol github.com/sprksocial/client
flutter atproto video dart
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: posthog screens

+24 -1
+24 -1
lib/src/sprk_app.dart
··· 2 2 import 'package:flutter/services.dart'; 3 3 import 'package:flutter_riverpod/flutter_riverpod.dart'; 4 4 import 'package:get_it/get_it.dart'; 5 + import 'package:posthog_flutter/posthog_flutter.dart'; 5 6 import 'package:spark/src/core/design_system/theme/app_theme.dart'; 6 7 import 'package:spark/src/core/l10n/app_localizations.dart'; 7 8 import 'package:spark/src/core/routing/app_router.dart'; ··· 89 90 } 90 91 return supportedLocales.first; 91 92 }, 92 - routerConfig: _appRouter.config(), 93 + routerConfig: _appRouter.config( 94 + navigatorObservers: () => [ 95 + PosthogObserver(nameExtractor: _postHogScreenName), 96 + ], 97 + ), 93 98 ); 94 99 } 95 100 } 101 + 102 + String? _postHogScreenName(RouteSettings settings) { 103 + final name = settings.name?.trim(); 104 + if (name == null || name.isEmpty) { 105 + return null; 106 + } 107 + 108 + if (name == '/') { 109 + return 'Root'; 110 + } 111 + 112 + const routeSuffix = 'Route'; 113 + if (name.endsWith(routeSuffix)) { 114 + return name.substring(0, name.length - routeSuffix.length); 115 + } 116 + 117 + return name; 118 + }