bizz84 / bizz84/starter_architecture_flutter_firebase

After tapping 'Retry' button, loading screen does not reappear

Open
#147 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Dart
Stars
1.8k
Forks
488
PR merge metrics
No merged PRs in 30d

Description

https://github.com/bizz84/starter_architecture_flutter_firebase/blob/6ad66f363e3fe956d1371cdcf9fe7df569066609/lib/src/app_startup.dart#L39

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 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
]);
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at lib/src/app_startup.dart around line 39 and run the app through the failure path, then tap Retry to observe whether invalidating the provider changes the visible state. Compare that behavior with the proposed loading-state assignment; done requires a maintainer-confirmed expected Retry transition and an agreed resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.