CWA-221 | reworked seed_language_page as adaptive page; added crypto_lock_light; decreased font size of wallet address on the wallet card

Oleksandr Sobol committed Jun 10, 2020 at 16:08 UTC e23f471df46df47bf3278ade1576be35db2cf80f
5 files changed +71 -54
assets/images/2.0x/crypto_lock_light.png
Binary files /dev/null and b/assets/images/2.0x/crypto_lock_light.png differ
assets/images/3.0x/crypto_lock_light.png
Binary files /dev/null and b/assets/images/3.0x/crypto_lock_light.png differ
assets/images/crypto_lock_light.png
Binary files /dev/null and b/assets/images/crypto_lock_light.png differ
lib/src/screens/dashboard/widgets/wallet_card.dart
+8 -6
@@ -374,7 +374,6 @@ class WalletCardState extends State<WalletCard> {
374 child: Container(
375 height: 90,
376 child: Column(
377 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
377 crossAxisAlignment: CrossAxisAlignment.start,
378 children: <Widget>[
379 Text(
@@ -396,18 +395,21 @@ class WalletCardState extends State<WalletCard> {
395 try {
396 _addressObserverKey.currentState.setState(() {
397 messageBoxHeight = 0;
399 - messageBoxWidth = cardWidth - 10;
398 + messageBoxWidth = cardWidth;
399 });
400 } catch(e) {
401 print('${e.toString()}');
402 }
403 });
404 },
406 - child: Text(
407 - walletStore.subaddress.address,
408 - style: TextStyle(
409 - fontSize: 14,
405 + child: Padding(
406 + padding: EdgeInsets.only(top: 5),
407 + child: Text(
408 + walletStore.subaddress.address,
409 + style: TextStyle(
410 + fontSize: 12,
411 color: Theme.of(context).primaryTextTheme.title.color
412 + ),
413 ),
414 ),
415 )
lib/src/screens/seed_language/seed_language_page.dart
+63 -48
@@ -5,10 +5,11 @@ import 'package:flutter/cupertino.dart';
5 import 'package:cake_wallet/generated/i18n.dart';
6 import 'package:cake_wallet/src/screens/base_page.dart';
7 import 'package:cake_wallet/src/widgets/primary_button.dart';
8 -import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
8 import 'package:cake_wallet/src/stores/seed_language/seed_language_store.dart';
9 import 'package:cake_wallet/src/screens/new_wallet/widgets/select_button.dart';
10 import 'package:cake_wallet/src/screens/seed_language/widgets/seed_language_picker.dart';
11 +import 'package:cake_wallet/themes.dart';
12 +import 'package:cake_wallet/theme_changer.dart';
13
14 class SeedLanguage extends BasePage {
15 @override
@@ -22,11 +23,15 @@ class SeedLanguageForm extends StatefulWidget {
23
24 class SeedLanguageFormState extends State<SeedLanguageForm> {
25 static const aspectRatioImage = 1.22;
25 - final walletNameImage = Image.asset('assets/images/wallet_name.png');
26 + final walletNameImageLight = Image.asset('assets/images/wallet_name_light.png');
27 + final walletNameImageDark = Image.asset('assets/images/wallet_name.png');
28
29 @override
30 Widget build(BuildContext context) {
31 final seedLanguageStore = Provider.of<SeedLanguageStore>(context);
32 + final _themeChanger = Provider.of<ThemeChanger>(context);
33 + final walletNameImage = _themeChanger.getTheme() == Themes.darkTheme
34 + ? walletNameImageDark : walletNameImageLight;
35
36 final List<String> seedLocales = [
37 S.current.seed_language_english,
@@ -40,55 +45,65 @@ class SeedLanguageFormState extends State<SeedLanguageForm> {
45 ];
46
47 return Container(
43 - padding: EdgeInsets.only(top: 24),
44 - child: ScrollableWithBottomSection(
45 - contentPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
46 - content: Column(
47 - crossAxisAlignment: CrossAxisAlignment.center,
48 - children: [
49 - Padding(
50 - padding: EdgeInsets.only(left: 12, right: 12),
51 - child: AspectRatio(
52 - aspectRatio: aspectRatioImage,
53 - child: FittedBox(child: walletNameImage, fit: BoxFit.fill)),
54 - ),
55 - Padding(padding: EdgeInsets.only(top: 40),
56 - child: Text(
57 - S.of(context).seed_language_choose,
58 - textAlign: TextAlign.center,
59 - style: TextStyle(
60 - fontSize: 16.0,
61 - fontWeight: FontWeight.w600,
62 - color: Theme.of(context).primaryTextTheme.title.color
48 + padding: EdgeInsets.all(24),
49 + child: Column(
50 + children: <Widget>[
51 + Flexible(
52 + flex: 2,
53 + child: AspectRatio(
54 + aspectRatio: aspectRatioImage,
55 + child: FittedBox(child: walletNameImage, fit: BoxFit.fill)
56 + )
57 + ),
58 + Flexible(
59 + flex: 3,
60 + child: Column(
61 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
62 + children: <Widget>[
63 + Column(
64 + children: <Widget>[
65 + Padding(padding: EdgeInsets.only(top: 48),
66 + child: Text(
67 + S.of(context).seed_language_choose,
68 + textAlign: TextAlign.center,
69 + style: TextStyle(
70 + fontSize: 16.0,
71 + fontWeight: FontWeight.w600,
72 + color: Theme.of(context).primaryTextTheme.title.color
73 + ),
74 + ),
75 ),
64 - ),
65 - ),
66 - Padding(padding: EdgeInsets.only(top: 24),
67 - child: Observer(
68 - builder: (_) => SelectButton(
69 - image: null,
70 - text: seedLocales[seedLanguages.indexOf(seedLanguageStore.selectedSeedLanguage)],
71 - color: Theme.of(context).accentTextTheme.title.backgroundColor,
72 - textColor: Theme.of(context).primaryTextTheme.title.color,
73 - onTap: () async => await showDialog(
74 - context: context,
75 - builder: (BuildContext context) => SeedLanguagePicker()
76 + Padding(padding: EdgeInsets.only(top: 24),
77 + child: Observer(
78 + builder: (_) => SelectButton(
79 + image: null,
80 + text: seedLocales[seedLanguages.indexOf(seedLanguageStore.selectedSeedLanguage)],
81 + color: Theme.of(context).accentTextTheme.title.backgroundColor,
82 + textColor: Theme.of(context).primaryTextTheme.title.color,
83 + onTap: () async => await showDialog(
84 + context: context,
85 + builder: (BuildContext context) => SeedLanguagePicker()
86 + )
87 )
77 - )
78 - ),
88 + ),
89 + )
90 + ],
91 + ),
92 + Observer(
93 + builder: (context) {
94 + return PrimaryButton(
95 + onPressed: () =>
96 + Navigator.of(context).popAndPushNamed(seedLanguageStore.currentRoute),
97 + text: S.of(context).seed_language_next,
98 + color: Colors.green,
99 + textColor: Colors.white);
100 + },
101 )
80 - ]),
81 - bottomSectionPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
82 - bottomSection: Observer(
83 - builder: (context) {
84 - return PrimaryButton(
85 - onPressed: () =>
86 - Navigator.of(context).popAndPushNamed(seedLanguageStore.currentRoute),
87 - text: S.of(context).seed_language_next,
88 - color: Colors.green,
89 - textColor: Colors.white);
90 - },
91 - )),
102 + ],
103 + )
104 + )
105 + ],
106 + )
107 );
108 }
109 }