MVP #141
@@ -56,7 +56,7 @@ class _CustomNavigationBarState extends State<CustomNavigationBar>
|
||||
onPressed: () async {
|
||||
await Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (_) => SettingsView()),
|
||||
MaterialPageRoute(builder: (_) => const SettingsView()),
|
||||
);
|
||||
setState(() {
|
||||
tabKeyCount++;
|
||||
|
||||
@@ -22,7 +22,6 @@ 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,
|
||||
@@ -51,9 +50,6 @@ class _GameHistoryViewState extends State<GameHistoryView> {
|
||||
|
||||
Future.wait([_gameListFuture]).then((result) async {
|
||||
await Future.delayed(const Duration(milliseconds: 250));
|
||||
setState(() {
|
||||
isLoading = false;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -87,14 +83,14 @@ class _GameHistoryViewState extends State<GameHistoryView> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
final bool isLoading =
|
||||
snapshot.connectionState == ConnectionState.waiting;
|
||||
final List<Game> games =
|
||||
(isLoading ? skeletonData : (snapshot.data ?? [])
|
||||
..sort(
|
||||
(a, b) => b.createdAt.compareTo(a.createdAt),
|
||||
))
|
||||
.toList();
|
||||
|
||||
return AppSkeleton(
|
||||
enabled: isLoading,
|
||||
child: ListView.builder(
|
||||
|
||||
Reference in New Issue
Block a user