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
With the current code, when I tap the Retry button, no UI change occurs when the provider is invalidated (the UI stays on the error screen and does not show the loading widget).
Is this the intended behavior?
I made a modifications to make the loading state always appear when refreshing from an error, are there any potential downsides you see to this modification?
@Riverpod(keepAlive: true)
Future<void> appStartup(AppStartupRef ref) async {
ref.onDispose(() {
// ensure dependent providers are disposed as well
});
// (NEW) Set the initial state to loading
ref.state = const AsyncValue.loading();
await Future.wait([
Future.delayed(const Duration(seconds: 5), () {
throw Exception('Error after 5 seconds');
}),
// list of providers to be warmed up
]);
}
The text was updated successfully, but these errors were encountered:
starter_architecture_flutter_firebase/lib/src/app_startup.dart
Line 39 in 6ad66f3
With the current code, when I tap the Retry button, no UI change occurs when the provider is invalidated (the UI stays on the error screen and does not show the loading widget).
Is this the intended behavior?
I made a modifications to make the loading state always appear when refreshing from an error, are there any potential downsides you see to this modification?
The text was updated successfully, but these errors were encountered: