@@ -58,24 +58,39 @@ class ChooseAccountPage extends StatelessWidget {
58
58
final globalStore = GlobalStoreWidget .of (context);
59
59
return Scaffold (
60
60
appBar: AppBar (title: const Text ('Choose account' )),
61
- body: SafeArea (
62
- minimum: const EdgeInsets .all (8 ),
63
- child: Center (
64
- child: ConstrainedBox (
65
- constraints: const BoxConstraints (maxWidth: 400 ),
66
- child: Column (mainAxisAlignment: MainAxisAlignment .center, children: [
67
- for (final (: accountId, : account) in globalStore.accountEntries)
68
- _buildAccountItem (context,
69
- accountId: accountId,
70
- title: Text (account.realmUrl.toString ()),
71
- subtitle: Text (account.email)),
72
- const SizedBox (height: 12 ),
73
- ElevatedButton (
74
- onPressed: () => Navigator .push (context,
75
- AddAccountPage .buildRoute ()),
76
- child: const Text ('Add an account' )),
77
- ]))),
78
- ));
61
+ body: Column (crossAxisAlignment: CrossAxisAlignment .stretch, children: [
62
+ Builder (builder: (context) =>
63
+ MediaQuery .removePadding (
64
+ context: context,
65
+ removeBottom: true ,
66
+ child: Expanded (
67
+ child: SingleChildScrollView (
68
+ child: SafeArea (
69
+ minimum: const EdgeInsets .all (8 ),
70
+ child: Center (
71
+ child: ConstrainedBox (
72
+ constraints: const BoxConstraints (maxWidth: 400 ),
73
+ child: Column (children: [
74
+ for (final (: accountId, : account) in globalStore.accountEntries)
75
+ _buildAccountItem (context,
76
+ accountId: accountId,
77
+ title: Text (account.realmUrl.toString ()),
78
+ subtitle: Text (account.email)),
79
+ ])))))))),
80
+ const Divider (height: 0 ), // remove padding; height clamped to 1 physical pixel
81
+ // TODO might look odd on wide screens, like tablets; adapt?
82
+ SafeArea (
83
+ minimum: const EdgeInsets .all (8 ),
84
+ child: Column (children: [
85
+ MenuItemButton (
86
+ // round corners; not flush with device edge (SafeArea padding)
87
+ style: const ButtonStyle (shape: MaterialStatePropertyAll (StadiumBorder ())),
88
+ leadingIcon: const Icon (Icons .add),
89
+ onPressed: () => Navigator .push (context,
90
+ AddAccountPage .buildRoute ()),
91
+ child: const Text ('Add an account' )),
92
+ ])),
93
+ ]));
79
94
}
80
95
}
81
96
0 commit comments