Skip to content

Commit

Permalink
Fix loading widgets in home
Browse files Browse the repository at this point in the history
This fixes a crash reported where ongoing game provider was disposed
when still being in a loading state.
  • Loading branch information
veloce committed Oct 18, 2024
1 parent 00b5b87 commit 33904fc
Show file tree
Hide file tree
Showing 2 changed files with 266 additions and 260 deletions.
2 changes: 2 additions & 0 deletions lib/src/network/connectivity.dart
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ extension AsyncValueConnectivity on AsyncValue<ConnectivityStatus> {
required R Function() offline,
}) {
return maybeWhen(
skipLoadingOnReload: true,
data: (status) => status.isOnline ? online() : offline(),
orElse: offline,
);
Expand All @@ -199,6 +200,7 @@ extension AsyncValueConnectivity on AsyncValue<ConnectivityStatus> {
required R Function() loading,
}) {
return when(
skipLoadingOnReload: true,
data: (status) => status.isOnline ? online() : offline(),
loading: loading,
error: (error, stack) => offline(),
Expand Down
Loading

0 comments on commit 33904fc

Please sign in to comment.