CWA-205 | applied new design to restore button, restore options page and restore wallet options page; deleted base restore widget and image widget

Oleksandr Sobol committed Apr 30, 2020 at 21:59 UTC 75dc42e6da21fe421f4914ed1ddcb146335ef3ee
18 files changed +116 -201
assets/images/2.0x/backup.png
Binary files /dev/null and b/assets/images/2.0x/backup.png differ
assets/images/2.0x/restore_keys.png
Binary files /dev/null and b/assets/images/2.0x/restore_keys.png differ
assets/images/2.0x/restore_seed.png
Binary files /dev/null and b/assets/images/2.0x/restore_seed.png differ
assets/images/2.0x/restore_wallet_image.png
Binary files /dev/null and b/assets/images/2.0x/restore_wallet_image.png differ
assets/images/3.0x/backup.png
Binary files /dev/null and b/assets/images/3.0x/backup.png differ
assets/images/3.0x/restore_keys.png
Binary files /dev/null and b/assets/images/3.0x/restore_keys.png differ
assets/images/3.0x/restore_seed.png
Binary files /dev/null and b/assets/images/3.0x/restore_seed.png differ
assets/images/3.0x/restore_wallet_image.png
Binary files /dev/null and b/assets/images/3.0x/restore_wallet_image.png differ
assets/images/backup.png
Binary files /dev/null and b/assets/images/backup.png differ
assets/images/restore_keys.png
Binary files /dev/null and b/assets/images/restore_keys.png differ
assets/images/restore_seed.png
Binary files /dev/null and b/assets/images/restore_seed.png differ
assets/images/restore_wallet_image.png
Binary files /dev/null and b/assets/images/restore_wallet_image.png differ
lib/src/screens/base_page.dart
+1 -1
@@ -63,7 +63,7 @@ abstract class BasePage extends StatelessWidget {
63 : Text(
64 title,
65 style: TextStyle(
66 - fontSize: 22.0,
66 + fontSize: 18.0,
67 fontWeight: FontWeight.bold,
68 color: Colors.white),
69 //color: Theme.of(context).primaryTextTheme.title.color),
lib/src/screens/restore/restore_options_page.dart
+27 -37
@@ -3,57 +3,47 @@ import 'package:cake_wallet/palette.dart';
3 import 'package:cake_wallet/routes.dart';
4 import 'package:flutter/cupertino.dart';
5 import 'package:cake_wallet/src/screens/restore/widgets/restore_button.dart';
6 -import 'package:cake_wallet/src/screens/restore/widgets/image_widget.dart';
7 -import 'package:cake_wallet/src/screens/restore/widgets/base_restore_widget.dart';
6 import 'package:cake_wallet/src/screens/base_page.dart';
7 import 'package:cake_wallet/generated/i18n.dart';
8
9 class RestoreOptionsPage extends BasePage {
12 - static const _aspectRatioImage = 2.086;
10
11 @override
12 String get title => S.current.restore_restore_wallet;
13
14 @override
18 - Color get backgroundColor => Palette.creamyGrey;
15 + Color get backgroundColor => PaletteDark.historyPanel;
16
20 - final _imageSeedKeys = Image.asset('assets/images/seedKeys.png');
21 - final _imageRestoreSeed = Image.asset('assets/images/restoreSeed.png');
17 + final imageSeedKeys = Image.asset('assets/images/restore_wallet_image.png');
18 + final imageBackup = Image.asset('assets/images/backup.png');
19
20 @override
21 Widget body(BuildContext context) {
25 - final isLargeScreen = MediaQuery.of(context).size.height > largeHeight;
26 -
27 - return BaseRestoreWidget(
28 - firstRestoreButton: RestoreButton(
29 - onPressed: () =>
30 - Navigator.pushNamed(
31 - context, Routes.restoreWalletOptionsFromWelcome),
32 - imageWidget: ImageWidget(
33 - image: _imageSeedKeys,
34 - aspectRatioImage: _aspectRatioImage,
35 - isLargeScreen: isLargeScreen,
36 - ),
37 - titleColor: Palette.lightViolet,
38 - color: Palette.lightViolet,
39 - title: S.of(context).restore_title_from_seed_keys,
40 - description: S.of(context).restore_description_from_seed_keys,
41 - textButton: S.of(context).restore_next,
42 - ),
43 - secondRestoreButton: RestoreButton(
44 - onPressed: () {},
45 - imageWidget: ImageWidget(
46 - image: _imageRestoreSeed,
47 - aspectRatioImage: _aspectRatioImage,
48 - isLargeScreen: isLargeScreen,
22 + return Container(
23 + padding: EdgeInsets.all(24),
24 + child: SingleChildScrollView(
25 + child: Column(
26 + children: <Widget>[
27 + RestoreButton(
28 + onPressed: () =>
29 + Navigator.pushNamed(
30 + context, Routes.restoreWalletOptionsFromWelcome),
31 + image: imageSeedKeys,
32 + title: S.of(context).restore_title_from_seed_keys,
33 + description: S.of(context).restore_description_from_seed_keys
34 + ),
35 + Padding(
36 + padding: EdgeInsets.only(top: 24),
37 + child: RestoreButton(
38 + onPressed: () {},
39 + image: imageBackup,
40 + title: S.of(context).restore_title_from_backup,
41 + description: S.of(context).restore_description_from_backup
42 + ),
43 + )
44 + ],
45 ),
50 - titleColor: Palette.cakeGreen,
51 - color: Palette.cakeGreen,
52 - title: S.of(context).restore_title_from_backup,
53 - description: S.of(context).restore_description_from_backup,
54 - textButton: S.of(context).restore_next,
55 - ),
56 - isLargeScreen: isLargeScreen,
46 + )
47 );
48 }
49 }
lib/src/screens/restore/restore_wallet_options_page.dart
+37 -9
@@ -3,31 +3,59 @@ import 'package:flutter/cupertino.dart';
3 import 'package:cake_wallet/routes.dart';
4 import 'package:cake_wallet/palette.dart';
5 import 'package:cake_wallet/src/screens/restore/widgets/restore_button.dart';
6 -import 'package:cake_wallet/src/screens/restore/widgets/image_widget.dart';
7 -import 'package:cake_wallet/src/screens/restore/widgets/base_restore_widget.dart';
6 import 'package:cake_wallet/src/screens/base_page.dart';
7 import 'package:cake_wallet/generated/i18n.dart';
8 import 'package:cake_wallet/src/stores/seed_language/seed_language_store.dart';
9 import 'package:provider/provider.dart';
10
11 class RestoreWalletOptionsPage extends BasePage {
14 - static const _aspectRatioImage = 2.086;
12
13 @override
14 String get title => S.current.restore_seed_keys_restore;
15
16 @override
20 - Color get backgroundColor => Palette.creamyGrey;
17 + Color get backgroundColor => PaletteDark.historyPanel;
18
22 - final _imageSeed = Image.asset('assets/images/seedIco.png');
23 - final _imageKeys = Image.asset('assets/images/keysIco.png');
19 + final imageSeed = Image.asset('assets/images/restore_seed.png');
20 + final imageKeys = Image.asset('assets/images/restore_keys.png');
21
22 @override
23 Widget body(BuildContext context) {
24 final seedLanguageStore = Provider.of<SeedLanguageStore>(context);
28 - final isLargeScreen = MediaQuery.of(context).size.height > largeHeight;
25
30 - return BaseRestoreWidget(
26 + return Container(
27 + padding: EdgeInsets.all(24),
28 + child: SingleChildScrollView(
29 + child: Column(
30 + children: <Widget>[
31 + RestoreButton(
32 + onPressed: () {
33 + seedLanguageStore.setCurrentRoute(Routes.restoreWalletFromSeed);
34 + Navigator.pushNamed(context, Routes.seedLanguage);
35 + },
36 + image: imageSeed,
37 + title: S.of(context).restore_title_from_seed,
38 + description: S.of(context).restore_description_from_seed
39 + ),
40 + Padding(
41 + padding: EdgeInsets.only(top: 24),
42 + child: RestoreButton(
43 + onPressed: () {
44 + seedLanguageStore.setCurrentRoute(Routes.restoreWalletFromKeys);
45 + Navigator.pushNamed(context, Routes.seedLanguage);
46 + },
47 + image: imageKeys,
48 + title: S.of(context).restore_title_from_keys,
49 + description: S.of(context).restore_description_from_keys
50 + ),
51 + )
52 + ],
53 + ),
54 + )
55 + );
56 +
57 +
58 + /*BaseRestoreWidget(
59 firstRestoreButton: RestoreButton(
60 onPressed: () {
61 seedLanguageStore.setCurrentRoute(Routes.restoreWalletFromSeed);
@@ -59,6 +87,6 @@ class RestoreWalletOptionsPage extends BasePage {
87 textButton: S.of(context).restore_next,
88 ),
89 isLargeScreen: isLargeScreen,
62 - );
90 + );*/
91 }
92 }
lib/src/screens/restore/widgets/base_restore_widget.dart deleted
-44
@@ -1,44 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -const largeHeight = 700;
4 -
5 -class BaseRestoreWidget extends StatelessWidget {
6 - BaseRestoreWidget({
7 - @required this.firstRestoreButton,
8 - @required this.secondRestoreButton,
9 - this.isLargeScreen = false
10 - });
11 -
12 - final Widget firstRestoreButton;
13 - final Widget secondRestoreButton;
14 - final bool isLargeScreen;
15 -
16 - @override
17 - Widget build(BuildContext context) {
18 - return Container(
19 - padding: EdgeInsets.only(
20 - left: 20.0,
21 - right: 20.0,
22 - ),
23 - child: isLargeScreen
24 - ? Column(
25 - children: <Widget>[
26 - Flexible(
27 - child: firstRestoreButton
28 - ),
29 - Flexible(
30 - child: secondRestoreButton
31 - )
32 - ],
33 - )
34 - : SingleChildScrollView(
35 - child: Column(
36 - children: <Widget>[
37 - firstRestoreButton,
38 - secondRestoreButton
39 - ],
40 - ),
41 - )
42 - );
43 - }
44 -}
\ No newline at end of file
lib/src/screens/restore/widgets/image_widget.dart deleted
-29
@@ -1,29 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class ImageWidget extends StatelessWidget {
4 - ImageWidget({
5 - @required this.image,
6 - @required this.aspectRatioImage,
7 - this.isLargeScreen = false});
8 -
9 - final Image image;
10 - final double aspectRatioImage;
11 - final bool isLargeScreen;
12 -
13 - @override
14 - Widget build(BuildContext context) {
15 - return isLargeScreen
16 - ? Flexible(
17 - child: Container(
18 - child: AspectRatio(
19 - aspectRatio: aspectRatioImage,
20 - child: FittedBox(
21 - fit: BoxFit.contain,
22 - child: image,
23 - ),
24 - ),
25 - ),
26 - )
27 - : image;
28 - }
29 -}
\ No newline at end of file
lib/src/screens/restore/widgets/restore_button.dart
+51 -81
@@ -1,101 +1,71 @@
1 +import 'package:flutter/cupertino.dart';
2 import 'package:flutter/material.dart';
3 import 'package:cake_wallet/palette.dart';
3 -import 'package:auto_size_text/auto_size_text.dart';
4
5 class RestoreButton extends StatelessWidget {
6 - const RestoreButton(
7 - {@required this.onPressed,
8 - @required this.imageWidget,
9 - @required this.color,
10 - @required this.titleColor,
11 - this.title = '',
12 - this.description = '',
13 - this.textButton = ''});
6 + const RestoreButton({
7 + @required this.onPressed,
8 + @required this.image,
9 + @required this.title,
10 + @required this.description});
11
12 final VoidCallback onPressed;
16 - final Widget imageWidget;
17 - final Color color;
18 - final Color titleColor;
13 + final Image image;
14 final String title;
15 final String description;
21 - final String textButton;
16
17 @override
18 Widget build(BuildContext context) {
25 - return Container(
26 - margin: EdgeInsets.only(top: 20.0, bottom: 20.0),
27 - decoration: BoxDecoration(
28 - color: Theme.of(context).accentTextTheme.headline.backgroundColor,
29 - borderRadius: BorderRadius.all(Radius.circular(20.0)),
30 - boxShadow: [
31 - BoxShadow(
32 - color: Palette.buttonShadow,
33 - blurRadius: 10,
34 - offset: Offset(
35 - 0,
36 - 12,
37 - ),
38 - )
39 - ]),
40 - child: InkWell(
41 - onTap: onPressed,
42 - borderRadius: BorderRadius.all(Radius.circular(20.0)),
43 - child: Column(
44 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
45 - children: <Widget>[
46 - imageWidget,
47 - Column(
48 - children: <Widget>[
49 - Padding(
50 - padding: EdgeInsets.only(left: 20, right: 20),
51 - child: AutoSizeText(
19 + return GestureDetector(
20 + onTap: onPressed,
21 + child: Container(
22 + width: double.infinity,
23 + height: 140,
24 + padding: EdgeInsets.all(24),
25 + alignment: Alignment.topLeft,
26 + decoration: BoxDecoration(
27 + borderRadius: BorderRadius.all(Radius.circular(12)),
28 + color: PaletteDark.menuList
29 + ),
30 + child: Row(
31 + mainAxisSize: MainAxisSize.max,
32 + mainAxisAlignment: MainAxisAlignment.start,
33 + crossAxisAlignment: CrossAxisAlignment.start,
34 + children: <Widget>[
35 + image,
36 + Expanded(
37 + child: Padding(
38 + padding: EdgeInsets.only(left: 16),
39 + child: Column(
40 + mainAxisSize: MainAxisSize.max,
41 + mainAxisAlignment: MainAxisAlignment.start,
42 + crossAxisAlignment: CrossAxisAlignment.start,
43 + children: <Widget>[
44 + Text(
45 title,
53 - textAlign: TextAlign.center,
46 style: TextStyle(
55 - color: titleColor,
56 - fontWeight: FontWeight.bold),
57 - maxLines: 2,
47 + fontSize: 16,
48 + fontWeight: FontWeight.w600,
49 + color: Colors.white
50 + ),
51 ),
59 - ),
60 - Padding(
61 - padding: EdgeInsets.only(left: 20, right: 20, top: 10),
62 - child: AutoSizeText(
63 - description,
64 - textAlign: TextAlign.center,
65 - style: TextStyle(
66 - color: Theme.of(context).accentTextTheme.subhead.color,
52 + Padding(
53 + padding: EdgeInsets.only(top: 5),
54 + child: Text(
55 + title,
56 + style: TextStyle(
57 + fontSize: 14,
58 + color: PaletteDark.walletCardText
59 + ),
60 ),
68 - maxLines: 2,
61 )
70 - )
71 - ],
62 + ],
63 + ),
64 ),
73 - SizedBox(
74 - height: 20,
75 - ),
76 - Container(
77 - height: 56.0,
78 - decoration: BoxDecoration(
79 - border: Border(
80 - top: BorderSide(
81 - color: Theme.of(context)
82 - .accentTextTheme
83 - .headline
84 - .decorationColor,
85 - width: 1.15)),
86 - color: Colors.transparent,
87 - ),
88 - child: Center(
89 - child: Text(
90 - textButton,
91 - style: TextStyle(
92 - color: color,
93 - fontSize: 16.0,
94 - fontWeight: FontWeight.bold),
95 - ),
96 - ))
97 - ],
98 - )),
65 + )
66 + ],
67 + ),
68 + ),
69 );
70 }
71 }