Removed safe area on welcome screen and wallet list screen.

M committed Feb 9, 2021 at 19:57 UTC 449155af4a796a7c33ebcffbc866314e6c9f66dd
2 files changed +32 -26
lib/src/screens/wallet_list/wallet_list_page.dart
+29 -24
@@ -47,16 +47,13 @@ class WalletListBodyState extends State<WalletListBody> {
47 @override
48 Widget build(BuildContext context) {
49 final newWalletImage = Image.asset('assets/images/new_wallet.png',
50 - height: 12,
51 - width: 12,
52 - color: Colors.white);
50 + height: 12, width: 12, color: Colors.white);
51 final restoreWalletImage = Image.asset('assets/images/restore_wallet.png',
52 height: 12,
53 width: 12,
54 color: Theme.of(context).primaryTextTheme.title.color);
55
58 - return SafeArea(
59 - child: Container(
56 + return Container(
57 padding: EdgeInsets.only(top: 16),
58 child: ScrollableWithBottomSection(
59 contentPadding: EdgeInsets.only(bottom: 20),
@@ -83,18 +80,24 @@ class WalletListBodyState extends State<WalletListBody> {
80 }
81
82 final confirmed = await showPopUp<bool>(
86 - context: context,
87 - builder: (dialogContext) {
88 - return AlertWithTwoActions(
89 - alertTitle: S.of(context).change_wallet_alert_title,
90 - alertContent: S.of(context).change_wallet_alert_content(wallet.name),
91 - leftButtonText: S.of(context).cancel,
92 - rightButtonText: S.of(context).change,
93 - actionLeftButton: () =>
94 - Navigator.of(context).pop(false),
95 - actionRightButton: () =>
96 - Navigator.of(context).pop(true));
97 - }) ?? false;
83 + context: context,
84 + builder: (dialogContext) {
85 + return AlertWithTwoActions(
86 + alertTitle: S
87 + .of(context)
88 + .change_wallet_alert_title,
89 + alertContent: S
90 + .of(context)
91 + .change_wallet_alert_content(
92 + wallet.name),
93 + leftButtonText: S.of(context).cancel,
94 + rightButtonText: S.of(context).change,
95 + actionLeftButton: () =>
96 + Navigator.of(context).pop(false),
97 + actionRightButton: () =>
98 + Navigator.of(context).pop(true));
99 + }) ??
100 + false;
101
102 if (confirmed) {
103 await _loadWallet(wallet);
@@ -161,10 +164,12 @@ class WalletListBodyState extends State<WalletListBody> {
164 }),
165 ),
166 ),
164 - bottomSectionPadding: EdgeInsets.only(bottom: 24, right: 24, left: 24),
167 + bottomSectionPadding:
168 + EdgeInsets.only(bottom: 24, right: 24, left: 24),
169 bottomSection: Column(children: <Widget>[
170 PrimaryImageButton(
167 - onPressed: () => Navigator.of(context).pushNamed(Routes.newWalletType),
171 + onPressed: () =>
172 + Navigator.of(context).pushNamed(Routes.newWalletType),
173 image: newWalletImage,
174 text: S.of(context).wallet_list_create_new_wallet,
175 color: Theme.of(context).accentTextTheme.body2.color,
@@ -179,7 +184,7 @@ class WalletListBodyState extends State<WalletListBody> {
184 color: Theme.of(context).accentTextTheme.caption.color,
185 textColor: Theme.of(context).primaryTextTheme.title.color)
186 ])),
182 - ));
187 + );
188 }
189
190 Image _imageFor({WalletType type}) {
@@ -239,17 +244,17 @@ class WalletListBodyState extends State<WalletListBody> {
244 Future<void> _generateNewWallet() async {
245 try {
246 changeProcessText(S.of(context).creating_new_wallet);
242 - await widget.walletListViewModel.walletNewVM.create(options: 'English'); // FIXME: Unnamed constant
247 + await widget.walletListViewModel.walletNewVM
248 + .create(options: 'English'); // FIXME: Unnamed constant
249 hideProgressText();
250 await Navigator.of(context).pushNamed(Routes.preSeed);
245 - } catch(e) {
251 + } catch (e) {
252 changeProcessText(S.of(context).creating_new_wallet_error(e.toString()));
253 }
254 }
255
256 void changeProcessText(String text) {
251 - _progressBar = createBar<void>(text, duration: null)
252 - ..show(context);
257 + _progressBar = createBar<void>(text, duration: null)..show(context);
258 }
259
260 void hideProgressText() {
lib/src/screens/welcome/welcome_page.dart
+3 -2
@@ -17,7 +17,7 @@ class WelcomePage extends BasePage {
17 .of(context)
18 .backgroundColor,
19 resizeToAvoidBottomPadding: false,
20 - body: SafeArea(child: body(context)));
20 + body: body(context));
21 }
22
23 @override
@@ -43,8 +43,9 @@ class WelcomePage extends BasePage {
43 .color);
44
45 return WillPopScope(onWillPop: () async => false, child: Container(
46 - padding: EdgeInsets.all(24),
46 + padding: EdgeInsets.only(top: 64, bottom: 24, left: 24, right: 24),
47 child: Column(
48 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
49 children: <Widget>[
50 Flexible(
51 flex: 2,