Implemented Loading Indicator in MainMenu
This commit is contained in:
@@ -16,17 +16,23 @@ class MainMenuView extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _MainMenuViewState extends State<MainMenuView> {
|
class _MainMenuViewState extends State<MainMenuView> {
|
||||||
|
bool _isLoading = true;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
initState() {
|
initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
LocalStorageService.loadGameSessions().then((_) {
|
LocalStorageService.loadGameSessions().then((_) {
|
||||||
setState(() {});
|
setState(() {
|
||||||
|
_isLoading = false;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
print('MainMenuView build');
|
||||||
LocalStorageService.loadGameSessions();
|
LocalStorageService.loadGameSessions();
|
||||||
|
|
||||||
return CupertinoPageScaffold(
|
return CupertinoPageScaffold(
|
||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
navigationBar: CupertinoNavigationBar(
|
navigationBar: CupertinoNavigationBar(
|
||||||
@@ -57,7 +63,9 @@ class _MainMenuViewState extends State<MainMenuView> {
|
|||||||
),
|
),
|
||||||
child: CupertinoPageScaffold(
|
child: CupertinoPageScaffold(
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
child: Globals.gameList.isEmpty
|
child: _isLoading
|
||||||
|
? const Center(child: CupertinoActivityIndicator())
|
||||||
|
: Globals.gameList.isEmpty
|
||||||
? Column(
|
? Column(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.center, // Oben ausrichten
|
MainAxisAlignment.center, // Oben ausrichten
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ name: cabo_counter
|
|||||||
description: "Mobile app for the card game Cabo"
|
description: "Mobile app for the card game Cabo"
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
version: 0.1.5+113
|
version: 0.1.6+122
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.5.4
|
sdk: ^3.5.4
|
||||||
|
|||||||
Reference in New Issue
Block a user