Fixes

M committed Oct 12, 2020 at 11:47 UTC 9a169254a6111123388217415fe80206f0059c2e
5 files changed +163 -96
ios/Flutter/.last_build_id new
+1
@@ -0,0 +1 @@
1 +4dc2ef1ba73deeed13cd85894dacb10b
\ No newline at end of file
ios/Runner.xcodeproj/project.pbxproj
+3 -3
@@ -354,7 +354,7 @@
354 buildSettings = {
355 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
356 CLANG_ENABLE_MODULES = YES;
357 - CURRENT_PROJECT_VERSION = 4;
357 + CURRENT_PROJECT_VERSION = 7;
358 DEVELOPMENT_TEAM = 32J6BB6VUS;
359 ENABLE_BITCODE = NO;
360 FRAMEWORK_SEARCH_PATHS = (
@@ -493,7 +493,7 @@
493 buildSettings = {
494 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
495 CLANG_ENABLE_MODULES = YES;
496 - CURRENT_PROJECT_VERSION = 4;
496 + CURRENT_PROJECT_VERSION = 7;
497 DEVELOPMENT_TEAM = 32J6BB6VUS;
498 ENABLE_BITCODE = NO;
499 FRAMEWORK_SEARCH_PATHS = (
@@ -526,7 +526,7 @@
526 buildSettings = {
527 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
528 CLANG_ENABLE_MODULES = YES;
529 - CURRENT_PROJECT_VERSION = 4;
529 + CURRENT_PROJECT_VERSION = 7;
530 DEVELOPMENT_TEAM = 32J6BB6VUS;
531 ENABLE_BITCODE = NO;
532 FRAMEWORK_SEARCH_PATHS = (
lib/entities/fs_migration.dart
+8 -2
@@ -29,7 +29,8 @@ Future<void> migrate_android_v1() async {
29 await android_migrate_wallets(appDocDir: appDocDir);
30 }
31
32 -Future<void> ios_migrate_v1(Box<WalletInfo> walletInfoSource, Box<Trade> tradeSource, Box<Contact> contactSource) async {
32 +Future<void> ios_migrate_v1(Box<WalletInfo> walletInfoSource,
33 + Box<Trade> tradeSource, Box<Contact> contactSource) async {
34 final prefs = await SharedPreferences.getInstance();
35
36 if (prefs.getBool('ios_migration_v1_completed') ?? false) {
@@ -137,6 +138,11 @@ Future<void> ios_migrate_wallet_passwords() async {
138 final walletsDir = Directory('${appDocDir.path}/wallets');
139 final moneroWalletsDir = Directory('${walletsDir.path}/monero');
140
141 + if (!moneroWalletsDir.existsSync() || moneroWalletsDir.listSync().isEmpty) {
142 + await prefs.setBool('ios_migration_wallet_passwords_completed', true);
143 + return;
144 + }
145 +
146 moneroWalletsDir.listSync().forEach((item) async {
147 try {
148 if (item is Directory) {
@@ -385,7 +391,7 @@ Future<void> ios_migrate_trades_list(Box<Trade> tradeSource) async {
391
392 Future<void> ios_migrate_address_book(Box<Contact> contactSource) async {
393 final prefs = await SharedPreferences.getInstance();
388 -
394 +
395 if (prefs.getBool('ios_migration_address_book_completed') ?? false) {
396 return;
397 }
lib/router.dart
+2 -2
@@ -58,7 +58,7 @@ class Router {
58 return CupertinoPageRoute<void>(
59 builder: (_) => getIt.get<SetupPinCodePage>(
60 param1: (BuildContext context, dynamic _) =>
61 - Navigator.pushNamed(context, Routes.newWalletType)),
61 + Navigator.pushNamed(context, Routes.newWallet)),
62 fullscreenDialog: true);
63
64 case Routes.newWalletType:
@@ -128,7 +128,7 @@ class Router {
128 return CupertinoPageRoute<void>(
129 builder: (_) => getIt.get<SetupPinCodePage>(
130 param1: (BuildContext context, dynamic _) =>
131 - Navigator.pushNamed(context, Routes.restoreWalletType)),
131 + Navigator.pushNamed(context, Routes.restoreWalletOptions)),
132 fullscreenDialog: true);
133
134 case Routes.seed:
lib/src/screens/welcome/welcome_page.dart
+149 -89
@@ -14,118 +14,178 @@ class WelcomePage extends BasePage {
14 @override
15 Widget build(BuildContext context) {
16 return Scaffold(
17 - backgroundColor: Theme.of(context).backgroundColor,
17 + backgroundColor: Theme
18 + .of(context)
19 + .backgroundColor,
20 resizeToAvoidBottomPadding: false,
21 body: SafeArea(child: body(context)));
22 }
23
24 @override
25 Widget body(BuildContext context) {
24 - final welcomeImage = getIt.get<SettingsStore>().isDarkTheme
26 + final welcomeImage = getIt
27 + .get<SettingsStore>()
28 + .isDarkTheme
29 ? welcomeImageDark : welcomeImageLight;
30
31 final newWalletImage = Image.asset('assets/images/new_wallet.png',
32 height: 12,
33 width: 12,
30 - color: Theme.of(context).accentTextTheme.headline.decorationColor);
34 + color: Theme
35 + .of(context)
36 + .accentTextTheme
37 + .headline
38 + .decorationColor);
39 final restoreWalletImage = Image.asset('assets/images/restore_wallet.png',
40 height: 12,
41 width: 12,
34 - color: Theme.of(context).primaryTextTheme.title.color);
42 + color: Theme
43 + .of(context)
44 + .primaryTextTheme
45 + .title
46 + .color);
47
36 - return Container(
37 - padding: EdgeInsets.all(24),
38 - child: Column(
39 - children: <Widget>[
40 - Flexible(
41 - flex: 2,
42 - child: AspectRatio(
43 - aspectRatio: aspectRatioImage,
44 - child: FittedBox(child: welcomeImage, fit: BoxFit.fill)
45 - )
46 - ),
47 - Flexible(
48 - flex: 3,
49 - child: Column(
50 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
51 - children: <Widget>[
52 - Column(
48 + return WillPopScope(onWillPop: () async =>, child: Container(
49 + padding: EdgeInsets.all(24),
50 + child: Column(
51 + children: <Widget>[
52 + Flexible(
53 + flex: 2,
54 + child: AspectRatio(
55 + aspectRatio: aspectRatioImage,
56 + child: FittedBox(child: welcomeImage, fit: BoxFit.fill)
57 + )
58 + ),
59 + Flexible(
60 + flex: 3,
61 + child: Column(
62 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
63 children: <Widget>[
54 - Padding(
55 - padding: EdgeInsets.only(top: 24),
56 - child: Text(
57 - S.of(context).welcome,
58 - style: TextStyle(
59 - fontSize: 18,
60 - fontWeight: FontWeight.w500,
61 - color: Theme.of(context).accentTextTheme.display3.color,
64 + Column(
65 + children: <Widget>[
66 + Padding(
67 + padding: EdgeInsets.only(top: 24),
68 + child: Text(
69 + S
70 + .of(context)
71 + .welcome,
72 + style: TextStyle(
73 + fontSize: 18,
74 + fontWeight: FontWeight.w500,
75 + color: Theme
76 + .of(context)
77 + .accentTextTheme
78 + .display3
79 + .color,
80 + ),
81 + textAlign: TextAlign.center,
82 + ),
83 ),
63 - textAlign: TextAlign.center,
64 - ),
65 - ),
66 - Padding(
67 - padding: EdgeInsets.only(top: 5),
68 - child: Text(
69 - S.of(context).cake_wallet,
70 - style: TextStyle(
71 - fontSize: 36,
72 - fontWeight: FontWeight.bold,
73 - color: Theme.of(context).primaryTextTheme.title.color,
84 + Padding(
85 + padding: EdgeInsets.only(top: 5),
86 + child: Text(
87 + S
88 + .of(context)
89 + .cake_wallet,
90 + style: TextStyle(
91 + fontSize: 36,
92 + fontWeight: FontWeight.bold,
93 + color: Theme
94 + .of(context)
95 + .primaryTextTheme
96 + .title
97 + .color,
98 + ),
99 + textAlign: TextAlign.center,
100 + ),
101 ),
75 - textAlign: TextAlign.center,
76 - ),
77 - ),
78 - Padding(
79 - padding: EdgeInsets.only(top: 5),
80 - child: Text(
81 - S.of(context).first_wallet_text,
82 - style: TextStyle(
83 - fontSize: 16,
84 - fontWeight: FontWeight.w500,
85 - color: Theme.of(context).accentTextTheme.display3.color,
102 + Padding(
103 + padding: EdgeInsets.only(top: 5),
104 + child: Text(
105 + S
106 + .of(context)
107 + .first_wallet_text,
108 + style: TextStyle(
109 + fontSize: 16,
110 + fontWeight: FontWeight.w500,
111 + color: Theme
112 + .of(context)
113 + .accentTextTheme
114 + .display3
115 + .color,
116 + ),
117 + textAlign: TextAlign.center,
118 + ),
119 ),
87 - textAlign: TextAlign.center,
88 - ),
89 - ),
90 - ],
91 - ),
92 - Column(
93 - children: <Widget>[
94 - Text(
95 - S.of(context).please_make_selection,
96 - style: TextStyle(
97 - fontSize: 12,
98 - fontWeight: FontWeight.normal,
99 - color: Theme.of(context).accentTextTheme.display3.color,
100 - ),
101 - textAlign: TextAlign.center,
102 - ),
103 - Padding(
104 - padding: EdgeInsets.only(top: 24),
105 - child: PrimaryImageButton(
106 - onPressed: () => Navigator.pushNamed(context, Routes.newWallet),
107 - image: newWalletImage,
108 - text: S.of(context).create_new,
109 - color: Theme.of(context).accentTextTheme.subtitle.decorationColor,
110 - textColor: Theme.of(context).accentTextTheme.headline.decorationColor,
111 - ),
120 + ],
121 ),
113 - Padding(
114 - padding: EdgeInsets.only(top: 10),
115 - child: PrimaryImageButton(
116 - onPressed: () => Navigator.pushNamed(context, Routes.restoreWalletOptions),
117 - image: restoreWalletImage,
118 - text: S.of(context).restore_wallet,
119 - color: Theme.of(context).accentTextTheme.caption.color,
120 - textColor: Theme.of(context).primaryTextTheme.title.color),
122 + Column(
123 + children: <Widget>[
124 + Text(
125 + S
126 + .of(context)
127 + .please_make_selection,
128 + style: TextStyle(
129 + fontSize: 12,
130 + fontWeight: FontWeight.normal,
131 + color: Theme
132 + .of(context)
133 + .accentTextTheme
134 + .display3
135 + .color,
136 + ),
137 + textAlign: TextAlign.center,
138 + ),
139 + Padding(
140 + padding: EdgeInsets.only(top: 24),
141 + child: PrimaryImageButton(
142 + onPressed: () =>
143 + Navigator.pushNamed(context,
144 + Routes.newWalletFromWelcome),
145 + image: newWalletImage,
146 + text: S
147 + .of(context)
148 + .create_new,
149 + color: Theme
150 + .of(context)
151 + .accentTextTheme
152 + .subtitle
153 + .decorationColor,
154 + textColor: Theme
155 + .of(context)
156 + .accentTextTheme
157 + .headline
158 + .decorationColor,
159 + ),
160 + ),
161 + Padding(
162 + padding: EdgeInsets.only(top: 10),
163 + child: PrimaryImageButton(
164 + onPressed: () =>
165 + Navigator.pushNamed(context,
166 + Routes.restoreWalletOptionsFromWelcome),
167 + image: restoreWalletImage,
168 + text: S
169 + .of(context)
170 + .restore_wallet,
171 + color: Theme
172 + .of(context)
173 + .accentTextTheme
174 + .caption
175 + .color,
176 + textColor: Theme
177 + .of(context)
178 + .primaryTextTheme
179 + .title
180 + .color),
181 + )
182 + ],
183 )
184 ],
185 )
124 - ],
186 )
126 - )
127 - ],
128 - )
129 - );
187 + ],
188 + )
189 + ));
190 }
191 }