handling anonymous users in profile tab

This commit is contained in:
shilangyu 2020-09-08 21:45:17 +02:00
parent 9b3caf4927
commit 6449929030
1 changed files with 21 additions and 0 deletions

View File

@ -17,6 +17,27 @@ class UserProfileTab extends HookWidget {
return Observer(
builder: (ctx) {
if (ctx.watch<AccountsStore>().hasNoAccount) {
return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('No account was added.'),
FlatButton.icon(
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (_) => AccountsConfigPage()));
},
icon: Icon(Icons.add),
label: Text('Add account'),
)
],
),
),
);
}
var user = ctx.watch<AccountsStore>().defaultUser;
return Scaffold(