|
|
|
|
@ -93,19 +93,19 @@ class _SplashScreenState extends State<SplashPage> {
|
|
|
|
|
if (isAppOpenedFromCall) {
|
|
|
|
|
navigateToTeleConsult();
|
|
|
|
|
} else {
|
|
|
|
|
if (Utils.havePrivilege(124)) {
|
|
|
|
|
Navigator.of(getIt.get<NavigationService>().navigatorKey.currentContext!).pushAndRemoveUntil(CustomPageRoute(page: AppClosedPage()), (r) => false);
|
|
|
|
|
// if (Utils.havePrivilege(124)) {
|
|
|
|
|
// Navigator.of(getIt.get<NavigationService>().navigatorKey.currentContext!).pushAndRemoveUntil(CustomPageRoute(page: AppClosedPage()), (r) => false);
|
|
|
|
|
// } else {
|
|
|
|
|
if (await Utils.getBoolFromPrefs(CacheConst.firstLaunch)) {
|
|
|
|
|
// Navigator.of(context).pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: OnboardingScreen())));
|
|
|
|
|
Navigator.of(getIt.get<NavigationService>().navigatorKey.currentContext!).pushReplacement(FadePage(page: OnboardingScreen()));
|
|
|
|
|
} else {
|
|
|
|
|
if (await Utils.getBoolFromPrefs(CacheConst.firstLaunch)) {
|
|
|
|
|
// Navigator.of(context).pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: OnboardingScreen())));
|
|
|
|
|
Navigator.of(getIt.get<NavigationService>().navigatorKey.currentContext!).pushReplacement(FadePage(page: OnboardingScreen()));
|
|
|
|
|
} else {
|
|
|
|
|
// Navigator.of(context).pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: LandingNavigation())));
|
|
|
|
|
Navigator.of(getIt.get<NavigationService>().navigatorKey.currentContext!).pushReplacement(FadePage(page: LandingNavigation()));
|
|
|
|
|
}
|
|
|
|
|
// Navigator.of(context).pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: LandingNavigation())));
|
|
|
|
|
Navigator.of(getIt.get<NavigationService>().navigatorKey.currentContext!).pushReplacement(FadePage(page: LandingNavigation()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// var zoom = ZoomVideoSdk();
|
|
|
|
|
@ -127,24 +127,24 @@ class _SplashScreenState extends State<SplashPage> {
|
|
|
|
|
// Set initial app context tags
|
|
|
|
|
try {
|
|
|
|
|
final appState = getIt.get<AppState>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Set device and app metadata
|
|
|
|
|
Clarity.setCustomTag('app_version', ApiConsts.appVersionID.toString());
|
|
|
|
|
Clarity.setCustomTag('device_type', appState.deviceTypeID ?? 'unknown');
|
|
|
|
|
Clarity.setCustomTag('platform', Platform.isIOS ? 'ios' : 'android');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Set user context if authenticated
|
|
|
|
|
if (appState.isAuthenticated) {
|
|
|
|
|
final user = appState.getAuthenticatedUser();
|
|
|
|
|
if (user != null) {
|
|
|
|
|
// Set user ID for session tracking
|
|
|
|
|
Clarity.setCustomUserId(user.patientId.toString());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Set custom tags for filtering sessions
|
|
|
|
|
Clarity.setCustomTag('user_type', user.patientType?.toString() ?? 'unknown');
|
|
|
|
|
Clarity.setCustomTag('user_segment', user.outSa == 0 ? 'in_sa' : 'out_sa');
|
|
|
|
|
Clarity.setCustomTag('auth_status', 'authenticated');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Optional: Set other non-sensitive user properties
|
|
|
|
|
if (user.mobileNumber != null) {
|
|
|
|
|
// Mask phone number for privacy (show only last 4 digits)
|
|
|
|
|
@ -155,10 +155,9 @@ class _SplashScreenState extends State<SplashPage> {
|
|
|
|
|
} else {
|
|
|
|
|
Clarity.setCustomTag('auth_status', 'guest');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Send initialization event
|
|
|
|
|
Clarity.sendCustomEvent('app_initialized');
|
|
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
debugPrint('Failed to set Clarity user context: $e');
|
|
|
|
|
}
|
|
|
|
|
@ -171,8 +170,7 @@ class _SplashScreenState extends State<SplashPage> {
|
|
|
|
|
// GetIt.instance<CacheService>().remove(key: CacheConst.isAppOpenedFromCall);
|
|
|
|
|
Utils.removeFromPrefs(CacheConst.isAppOpenedFromCall);
|
|
|
|
|
|
|
|
|
|
Navigator.of(GetIt.instance<NavigationService>().navigatorKey.currentContext!)
|
|
|
|
|
.pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: LandingNavigation())));
|
|
|
|
|
Navigator.of(GetIt.instance<NavigationService>().navigatorKey.currentContext!).pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: LandingNavigation())));
|
|
|
|
|
Navigator.pushReplacementNamed(
|
|
|
|
|
// context,
|
|
|
|
|
GetIt.instance<NavigationService>().navigatorKey.currentContext!,
|
|
|
|
|
@ -392,8 +390,6 @@ class _SplashScreenState extends State<SplashPage> {
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Scaffold(
|
|
|
|
|
backgroundColor: AppColors.whiteColor,
|
|
|
|
|
body: Lottie.asset(AppAnimations.loadingAnimation,
|
|
|
|
|
repeat: true, reverse: false, frameRate: FrameRate(60), width: 80.h, height: 80.h, fit: BoxFit.fill)
|
|
|
|
|
.center);
|
|
|
|
|
body: Lottie.asset(AppAnimations.loadingAnimation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 80.h, height: 80.h, fit: BoxFit.fill).center);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|