fixed loading too fast
Some checks failed
Pull Request Pipeline / lint (pull_request) Failing after 2m10s
Pull Request Pipeline / test (pull_request) Successful in 5m6s

This commit is contained in:
gelbeinhalb
2025-11-27 16:58:02 +01:00
parent 099e587d45
commit b443230285

View File

@@ -17,6 +17,7 @@ class GameHistoryView extends StatefulWidget {
class _GameHistoryViewState extends State<GameHistoryView> {
late Future<List<Game>> _gameListFuture;
late final AppDatabase db;
late bool isLoading = true;
late final List<Game> skeletonData = List.filled(
4,
@@ -47,6 +48,9 @@ class _GameHistoryViewState extends State<GameHistoryView> {
Future.wait([_gameListFuture]).then((result) async {
await Future.delayed(const Duration(milliseconds: 250));
setState(() {
isLoading = false;
});
});
}
@@ -71,7 +75,6 @@ class _GameHistoryViewState extends State<GameHistoryView> {
);
}
final bool isLoading = snapshot.connectionState == ConnectionState.waiting;
final List<Game> games = (isLoading
? skeletonData
: (snapshot.data ?? [])