Changed layout
This commit is contained in:
@@ -22,26 +22,30 @@ 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();
|
||||||
if (DbHelper.currentUser == null) {
|
}
|
||||||
return const LoginPage();
|
return const Scaffold(body: Center(child: CircularProgressIndicator()));
|
||||||
}
|
},
|
||||||
return const Column(
|
);
|
||||||
children: [
|
}
|
||||||
Text('Logged in!'),
|
|
||||||
TextButton(
|
Widget _getContent() {
|
||||||
onPressed: DbHelper.logout,
|
if (DbHelper.currentUser == null) {
|
||||||
child: Text('Log out'),
|
return const LoginPage();
|
||||||
),
|
}
|
||||||
],
|
return const Scaffold(
|
||||||
);
|
body: Column(
|
||||||
}
|
children: [
|
||||||
return const Center(child: CircularProgressIndicator());
|
Text('Logged in!'),
|
||||||
},
|
TextButton(
|
||||||
|
onPressed: DbHelper.logout,
|
||||||
|
child: Text('Log out'),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user