diff --git a/lib/screen/onboarding_page.dart b/lib/screen/onboarding_page.dart index 7d0450f54..9be5da464 100644 --- a/lib/screen/onboarding_page.dart +++ b/lib/screen/onboarding_page.dart @@ -47,6 +47,7 @@ class _OnboardingPageState extends State final metricClient = injector.get(); final deepLinkService = injector.get(); + bool _skipMembership = false; final _onboardingLogo = Semantics( label: 'onboarding_logo', @@ -175,6 +176,9 @@ class _OnboardingPageState extends State setState(() { fromBranchLink = true; }); + if (data['source'] == 'gift_membership') { + _skipMembership = true; + } await injector().restoreIfNeeded(); deepLinkService.handleBranchDeeplinkData(data); @@ -200,13 +204,19 @@ class _OnboardingPageState extends State listener: (context, state) async { final isSubscribed = await injector() .isSubscribed(includeInhouse: false); + if (isSubscribed) { + _skipMembership = true; + } + if (_skipMembership) { + if (context.mounted) { + unawaited(Navigator.of(context) + .pushReplacementNamed(AppRouter.homePageNoTransition)); + return; + } + } switch (state.onboardingStep) { case OnboardingStep.dashboard: - - /// skip membership screen if user is already subscribed - /// or done new onboarding - if (injector().isDoneNewOnboarding() || - isSubscribed) { + if (injector().isDoneNewOnboarding()) { if (context.mounted) { unawaited(Navigator.of(context) .pushReplacementNamed(AppRouter.homePageNoTransition)); @@ -224,6 +234,8 @@ class _OnboardingPageState extends State if (state.onboardingStep != OnboardingStep.dashboard) { await injector().checkForUpdate(); } + + }, builder: (context, state) { if (state.isLoading) {