Launching lib/main.dart on iPhone 15 Pro Max in debug mode...
Xcode build done. 11.4s
[VERBOSE-2:FlutterDarwinContextMetalImpeller.mm(37)] Using the Impeller rendering backend.
Connecting to VM Service at ws://127.0.0.1:52753/2Ars7ne871s=/ws
flutter: ***** Supabase init completed Instance of 'Supabase'
flutter: ***** SupabaseDeepLinkingMixin startAuthObserver
flutter: (pecuniaSharedPreferencesProvider) : AsyncData<SharedPreferences>(value: Instance of 'SharedPreferences')...
flutter: (getLoggedInUserProvider) : AsyncData<Option<PecuniaUser>>(value: None)...
flutter: (getIsFirstOpenProvider) : AsyncData<Option<bool>>(value: Some(true))...
WidgetsBinding.instance.addPostFrameCallback((_) async {
final result = await ref.watch(getLoggedInUserProvider.future);
if (result.isSome()) {
context.goNamed('main');
} else {
debugPrint('No user logged in, checking if first open');
ref.watch(getIsFirstOpenProvider).whenData((isFirstOpen) {
isFirstOpen.fold(
() => debugPrint('Not First Open'),
(isFirstOpen) {
debugPrint('First open check succesfull, isFirstOpen: $isFirstOpen');
if (isFirstOpen) {
context.goNamed('onboarding');
} else {
context.goNamed('start');
}
},
);
});
}
});
The culprit is the whenData. I'm guessing by the time whenData is called, getIsFirstOpenProvider is still loading. So the whole thing doesn't get executed. Only until debugPrint('No user logged in, checking if first open');.
Here are the logs:
The culprit is the
whenData
. I'm guessing by the timewhenData
is called,getIsFirstOpenProvider
is still loading. So the whole thing doesn't get executed. Only untildebugPrint('No user logged in, checking if first open');
.