add delay and change empty games message
This commit is contained in:
@@ -46,11 +46,10 @@ class _GameHistoryViewState extends State<GameHistoryView> {
|
|||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
db = Provider.of<AppDatabase>(context, listen: false);
|
db = Provider.of<AppDatabase>(context, listen: false);
|
||||||
_gameListFuture = db.gameDao.getAllGames();
|
_gameListFuture = Future.delayed(
|
||||||
|
const Duration(milliseconds: 250),
|
||||||
Future.wait([_gameListFuture]).then((result) async {
|
() => db.gameDao.getAllGames(),
|
||||||
await Future.delayed(const Duration(milliseconds: 250));
|
);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -78,8 +77,8 @@ class _GameHistoryViewState extends State<GameHistoryView> {
|
|||||||
return const Center(
|
return const Center(
|
||||||
child: TopCenteredMessage(
|
child: TopCenteredMessage(
|
||||||
icon: Icons.report,
|
icon: Icons.report,
|
||||||
title: 'Error',
|
title: 'Info',
|
||||||
message: 'No Games Available',
|
message: 'No games created yet.',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user