Fixes
M committed
Oct 24, 2020 at 17:35 UTC
082a5f0b6ca6bd8ae2655a5abc3ef1e5e014f08d
5 files changed
+36
-29
lib/router.dart
+3
-3
@@ -85,10 +85,10 @@ Route<dynamic> createRoute(RouteSettings settings) {
85
builder: (_) => NewWalletPage(walletNewVM));
86
87
case Routes.setupPin:
88
- Function(BuildContext, String) callback;
88
+ Function(PinCodeState<PinCodeWidget>, String) callback;
89
90
- if (settings.arguments is Function(BuildContext, String)) {
91
- callback = settings.arguments as Function(BuildContext, String);
90
+ if (settings.arguments is Function(PinCodeState<PinCodeWidget>, String)) {
91
+ callback = settings.arguments as Function(PinCodeState<PinCodeWidget>, String);
92
}
93
94
return CupertinoPageRoute<void>(
lib/src/screens/dashboard/wallet_menu.dart
+15
-14
@@ -15,31 +15,31 @@ class WalletMenu {
15
WalletMenuItem(
16
title: S.current.reconnect,
17
image: Image.asset('assets/images/reconnect_menu.png',
18
- height: 16, width: 16)),
18
+ height: 16, width: 16)),
19
WalletMenuItem(
20
title: S.current.rescan,
21
image: Image.asset('assets/images/filter_icon.png',
22
- height: 16, width: 16)),
22
+ height: 16, width: 16)),
23
WalletMenuItem(
24
title: S.current.wallets,
25
image: Image.asset('assets/images/wallet_menu.png',
26
- height: 16, width: 16)),
26
+ height: 16, width: 16)),
27
WalletMenuItem(
28
title: S.current.nodes,
29
- image: Image.asset('assets/images/nodes_menu.png',
30
- height: 16, width: 16)),
29
+ image:
30
+ Image.asset('assets/images/nodes_menu.png', height: 16, width: 16)),
31
WalletMenuItem(
32
title: S.current.show_keys,
33
- image: Image.asset('assets/images/key_menu.png',
34
- height: 16, width: 16)),
33
+ image:
34
+ Image.asset('assets/images/key_menu.png', height: 16, width: 16)),
35
WalletMenuItem(
36
title: S.current.address_book_menu,
37
image: Image.asset('assets/images/open_book_menu.png',
38
- height: 16, width: 16)),
38
+ height: 16, width: 16)),
39
WalletMenuItem(
40
title: S.current.settings_title,
41
image: Image.asset('assets/images/settings_menu.png',
42
- height: 16, width: 16)),
42
+ height: 16, width: 16)),
43
];
44
45
final BuildContext context;
@@ -61,11 +61,12 @@ class WalletMenu {
61
break;
62
case 4:
63
Navigator.of(context).pushNamed(Routes.auth,
64
- arguments: (bool isAuthenticatedSuccessfully, AuthPageState auth) =>
65
- isAuthenticatedSuccessfully
66
- ? Navigator.of(auth.context)
67
- .popAndPushNamed(Routes.showKeys)
68
- : null);
64
+ arguments: (bool isAuthenticatedSuccessfully, AuthPageState auth) {
65
+ if (isAuthenticatedSuccessfully) {
66
+ auth.close();
67
+ Navigator.of(auth.context).pushNamed(Routes.showKeys);
68
+ }
69
+ });
70
break;
71
case 5:
72
Navigator.of(context).pushNamed(Routes.addressBook);
lib/src/screens/pin_code/pin_code_widget.dart
+5
@@ -89,6 +89,11 @@ class PinCodeState<T extends PinCodeWidget> extends State<T> {
89
..show(_key.currentContext);
90
}
91
92
+ void close() {
93
+ _progressBar?.dismiss();
94
+ Navigator.of(_key.currentContext).pop();
95
+ }
96
+
97
void hideProgressText() {
98
_progressBar?.dismiss();
99
_progressBar = null;
lib/view_model/settings/settings_view_model.dart
+12
-11
@@ -1,3 +1,4 @@
1
+import 'package:cake_wallet/src/screens/pin_code/pin_code_widget.dart';
2
import 'package:flutter/cupertino.dart';
3
import 'package:mobx/mobx.dart';
4
import 'package:package_info/package_info.dart';
@@ -64,16 +65,16 @@ abstract class SettingsViewModelBase with Store {
65
RegularListItem(
66
title: S.current.settings_change_pin,
67
handler: (BuildContext context) {
67
- Navigator.of(context).pushNamed(Routes.auth,
68
- arguments: (bool isAuthenticatedSuccessfully,
69
- AuthPageState auth) =>
70
- isAuthenticatedSuccessfully
71
- ? Navigator.of(context).popAndPushNamed(
72
- Routes.setupPin,
73
- arguments:
74
- (BuildContext setupPinContext, String _) =>
75
- Navigator.of(context).pop())
76
- : null);
68
+ Navigator.of(context).pushNamed(Routes.auth, arguments:
69
+ (bool isAuthenticatedSuccessfully, AuthPageState auth) {
70
+ auth.close();
71
+ if (isAuthenticatedSuccessfully) {
72
+ Navigator.of(context).pushNamed(Routes.setupPin, arguments:
73
+ (PinCodeState<PinCodeWidget> setupPinContext, String _) {
74
+ setupPinContext.close();
75
+ });
76
+ }
77
+ });
78
}),
79
RegularListItem(
80
title: S.current.settings_change_language,
@@ -99,7 +100,7 @@ abstract class SettingsViewModelBase with Store {
100
isAuthenticatedSuccessfully);
101
}
102
102
- Navigator.of(context).pop();
103
+ auth.close();
104
});
105
} else {
106
setAllowBiometricalAuthentication(value);
pubspec.lock
+1
-1
@@ -930,7 +930,7 @@ packages:
930
name: url_launcher
931
url: "https://pub.dartlang.org"
932
source: hosted
933
- version: "5.7.7"
933
+ version: "5.7.8"
934
url_launcher_linux:
935
dependency: transitive
936
description: