Changed layout
This commit is contained in:
@@ -22,15 +22,23 @@ class _SplashPageState extends State<SplashPage> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return FutureBuilder(
|
||||||
body: FutureBuilder(
|
|
||||||
future: loginFuture,
|
future: loginFuture,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (snapshot.hasData) {
|
if (snapshot.hasData) {
|
||||||
|
return _getContent();
|
||||||
|
}
|
||||||
|
return const Scaffold(body: Center(child: CircularProgressIndicator()));
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _getContent() {
|
||||||
if (DbHelper.currentUser == null) {
|
if (DbHelper.currentUser == null) {
|
||||||
return const LoginPage();
|
return const LoginPage();
|
||||||
}
|
}
|
||||||
return const Column(
|
return const Scaffold(
|
||||||
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
Text('Logged in!'),
|
Text('Logged in!'),
|
||||||
TextButton(
|
TextButton(
|
||||||
@@ -38,10 +46,6 @@ class _SplashPageState extends State<SplashPage> {
|
|||||||
child: Text('Log out'),
|
child: Text('Log out'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
|
||||||
}
|
|
||||||
return const Center(child: CircularProgressIndicator());
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user