You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am thinking how could I implement the same functionality without using Firebase. My authRepositoryProvider uses dio and hive that are initialized asynchronously in appStartupProvider.
However my application crashes because those dependencies aren't ready at this point:
@riverpod
GoRouter goRouter(GoRouterRef ref) {
final appStartupState = ref.watch(appStartupProvider);
// THIS LINE BLINKS ERROR BECAUSE DIO AND HIVE ARE STILL BEING INITIALIZED
final authRepository = ref.watch(authRepositoryProvider);
...
}
Any ideas how could I refactor this so that I can listen authRepository changes like your example does?
The text was updated successfully, but these errors were encountered:
Veeksi
changed the title
AuthRepository that returns Future
AuthRepository that depends on asynchronous providers
May 12, 2024
Hey,
Great example and thanks for that!
I am thinking how could I implement the same functionality without using Firebase. My authRepositoryProvider uses dio and hive that are initialized asynchronously in appStartupProvider.
However my application crashes because those dependencies aren't ready at this point:
Any ideas how could I refactor this so that I can listen authRepository changes like your example does?
The text was updated successfully, but these errors were encountered: