GameHistoryView anpassen #20
@@ -17,6 +17,7 @@ class GameHistoryView extends StatefulWidget {
|
|||||||
class _GameHistoryViewState extends State<GameHistoryView> {
|
class _GameHistoryViewState extends State<GameHistoryView> {
|
||||||
late Future<List<Game>> _gameListFuture;
|
late Future<List<Game>> _gameListFuture;
|
||||||
late final AppDatabase db;
|
late final AppDatabase db;
|
||||||
|
late bool isLoading = true;
|
||||||
|
|
||||||
|
gelbeinhalb marked this conversation as resolved
Outdated
|
|||||||
late final List<Game> skeletonData = List.filled(
|
late final List<Game> skeletonData = List.filled(
|
||||||
4,
|
4,
|
||||||
@@ -47,6 +48,9 @@ class _GameHistoryViewState extends State<GameHistoryView> {
|
|||||||
|
|
||||||
Future.wait([_gameListFuture]).then((result) async {
|
Future.wait([_gameListFuture]).then((result) async {
|
||||||
await Future.delayed(const Duration(milliseconds: 250));
|
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
|
final List<Game> games = (isLoading
|
||||||
? skeletonData
|
? skeletonData
|
||||||
: (snapshot.data ?? [])
|
: (snapshot.data ?? [])
|
||||||
|
|||||||
Reference in New Issue
Block a user
Ich würde die Skeleton-Daten so anpassen, dass du nicht mehr machst als auf den Screen passen. Also bei mir sind das glaub ich so 5
ja save :) hab 10 eingestellt zum testen und dann vergessen zu ändern