Fixes pre release.
M committed
Sep 25, 2020 at 18:32 UTC
34aa7fdc7667bc53fdc12ef21e562eb87d7c70c2
25 files changed
+124
-81
lib/monero/monero_wallet.dart
+1
-1
@@ -191,7 +191,7 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance> with Store {
191
192
@override
193
Future<void> rescan({int height}) async {
194
- // FIXME: Unimplemented
194
+ monero_wallet.rescanBlockchainAsync();
195
}
196
197
void _setListeners() {
lib/src/screens/contact/contact_list_page.dart
+3
-2
@@ -1,3 +1,4 @@
1
+import 'package:cake_wallet/utils/show_pop_up.dart';
2
import 'package:flutter/material.dart';
3
import 'package:flutter/cupertino.dart';
4
import 'package:flutter/services.dart';
@@ -246,7 +247,7 @@ class ContactListPage extends BasePage {
247
}
248
249
Future<bool> showAlertDialog(BuildContext context) async {
249
- return await showDialog(
250
+ return await showPopUp(
251
context: context,
252
builder: (BuildContext context) {
253
return AlertWithTwoActions(
@@ -261,7 +262,7 @@ class ContactListPage extends BasePage {
262
263
Future<bool> showNameAndAddressDialog(
264
BuildContext context, String name, String address) async {
264
- return await showDialog(
265
+ return await showPopUp(
266
context: context,
267
builder: (BuildContext context) {
268
return AlertWithTwoActions(
lib/src/screens/contact/contact_page.dart
+3
-2
@@ -1,4 +1,5 @@
1
import 'package:cake_wallet/palette.dart';
2
+import 'package:cake_wallet/utils/show_pop_up.dart';
3
import 'package:flutter/material.dart';
4
import 'package:flutter/cupertino.dart';
5
import 'package:flutter_mobx/flutter_mobx.dart';
@@ -138,7 +139,7 @@ class ContactPage extends BasePage {
139
}
140
141
void _presentCurrencyPicker(BuildContext context) {
141
- showDialog<void>(
142
+ showPopUp<void>(
143
builder: (_) => CurrencyPicker(
144
selectedAtIndex:
145
contactViewModel.currencies.indexOf(contactViewModel.currency),
@@ -150,7 +151,7 @@ class ContactPage extends BasePage {
151
}
152
153
void _onContactSavingFailure(BuildContext context, String error) {
153
- showDialog<void>(
154
+ showPopUp<void>(
155
context: context,
156
builder: (BuildContext context) {
157
return AlertWithOneAction(
lib/src/screens/dashboard/wallet_menu.dart
+2
-1
@@ -1,3 +1,4 @@
1
+import 'package:cake_wallet/utils/show_pop_up.dart';
2
import 'package:flutter/material.dart';
3
import 'package:cake_wallet/routes.dart';
4
import 'package:provider/provider.dart';
@@ -72,7 +73,7 @@ class WalletMenu {
73
}
74
75
Future<void> _presentReconnectAlert(BuildContext context) async {
75
- await showDialog<void>(
76
+ await showPopUp<void>(
77
context: context,
78
builder: (BuildContext context) {
79
return AlertWithTwoActions(
lib/src/screens/dashboard/widgets/header_row.dart
+2
-1
@@ -1,4 +1,5 @@
1
import 'package:cake_wallet/src/screens/dashboard/widgets/filter_widget.dart';
2
+import 'package:cake_wallet/utils/show_pop_up.dart';
3
import 'package:flutter/material.dart';
4
import 'package:cake_wallet/generated/i18n.dart';
5
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
@@ -31,7 +32,7 @@ class HeaderRow extends StatelessWidget {
32
),
33
GestureDetector(
34
onTap: () {
34
- showDialog<void>(
35
+ showPopUp<void>(
36
context: context,
37
builder: (context) => FilterWidget(dashboardViewModel: dashboardViewModel)
38
);
lib/src/screens/disclaimer/disclaimer_page.dart
+2
-1
@@ -1,5 +1,6 @@
1
import 'dart:ui';
2
import 'package:cake_wallet/palette.dart';
3
+import 'package:cake_wallet/utils/show_pop_up.dart';
4
import 'package:flutter/material.dart';
5
import 'package:flutter/cupertino.dart';
6
import 'package:flutter/services.dart';
@@ -51,7 +52,7 @@ class DisclaimerBodyState extends State<DisclaimerPageBody> {
52
}
53
54
Future<void> _showAlertDialog(BuildContext context) async {
54
- await showDialog<void>(
55
+ await showPopUp<void>(
56
context: context,
57
builder: (BuildContext context) {
58
return AlertWithOneAction(
lib/src/screens/exchange/exchange_page.dart
+3
-2
@@ -4,6 +4,7 @@ import 'package:cake_wallet/src/screens/base_page.dart';
4
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
5
import 'package:cake_wallet/src/widgets/template_tile.dart';
6
import 'package:cake_wallet/src/widgets/trail_button.dart';
7
+import 'package:cake_wallet/utils/show_pop_up.dart';
8
import 'package:dotted_border/dotted_border.dart';
9
import 'package:flutter/cupertino.dart';
10
import 'package:flutter/material.dart';
@@ -293,7 +294,7 @@ class ExchangePage extends BasePage {
294
exchangeViewModel, template);
295
},
296
onRemove: () {
296
- showDialog<void>(
297
+ showPopUp<void>(
298
context: context,
299
builder: (dialogContext) {
300
return AlertWithTwoActions(
@@ -492,7 +493,7 @@ class ExchangePage extends BasePage {
493
// reaction((_) => exchangeViewModel.tradeState, (ExchangeTradeState state) {
494
// if (state is TradeIsCreatedFailure) {
495
// WidgetsBinding.instance.addPostFrameCallback((_) {
495
- // showDialog<void>(
496
+ // showPopUp<void>(
497
// context: context,
498
// builder: (BuildContext context) {
499
// return AlertWithOneAction(
lib/src/screens/exchange/widgets/exchange_card.dart
+2
-1
@@ -1,3 +1,4 @@
1
+import 'package:cake_wallet/utils/show_pop_up.dart';
2
import 'package:flutter/services.dart';
3
import 'package:flutter/material.dart';
4
import 'package:cake_wallet/generated/i18n.dart';
@@ -303,7 +304,7 @@ class ExchangeCardState extends State<ExchangeCard> {
304
}
305
306
void _presentPicker(BuildContext context) {
306
- showDialog<void>(
307
+ showPopUp<void>(
308
builder: (_) => CurrencyPicker(
309
selectedAtIndex: widget.currencies.indexOf(_selectedCurrency),
310
items: widget.currencies,
lib/src/screens/exchange/widgets/present_provider_picker.dart
+2
-1
@@ -1,3 +1,4 @@
1
+import 'package:cake_wallet/utils/show_pop_up.dart';
2
import 'package:flutter/material.dart';
3
import 'package:cake_wallet/exchange/exchange_provider_description.dart';
4
import 'package:cake_wallet/exchange/exchange_provider.dart';
@@ -72,7 +73,7 @@ class PresentProviderPicker extends StatelessWidget {
73
}
74
}
75
75
- showDialog<void>(
76
+ showPopUp<void>(
77
builder: (_) => Picker(
78
items: items,
79
images: images,
lib/src/screens/exchange_trade/exchange_trade_page.dart
+5
-4
@@ -4,6 +4,7 @@ import 'package:cake_wallet/exchange/exchange_provider_description.dart';
4
import 'package:cake_wallet/src/screens/exchange_trade/exchange_trade_item.dart';
5
import 'package:cake_wallet/src/screens/exchange_trade/information_page.dart';
6
import 'package:cake_wallet/src/widgets/standart_list_row.dart';
7
+import 'package:cake_wallet/utils/show_pop_up.dart';
8
import 'package:cake_wallet/view_model/exchange/exchange_trade_view_model.dart';
9
import 'package:mobx/mobx.dart';
10
import 'package:provider/provider.dart';
@@ -37,7 +38,7 @@ void showInformation(ExchangeTradeViewModel exchangeTradeViewModel, BuildContext
38
: S.current.exchange_result_description(
39
trade.amount ?? fetchingLabel, trade.from.toString());
40
40
- showDialog<void>(
41
+ showPopUp<void>(
42
context: context,
43
builder: (_) => InformationPage(information: information)
44
);
@@ -255,7 +256,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
256
reaction((_) => sendStore.state, (SendingState state) {
257
if (state is SendingFailed) {
258
WidgetsBinding.instance.addPostFrameCallback((_) {
258
- showDialog<void>(
259
+ showPopUp<void>(
260
context: context,
261
builder: (BuildContext context) {
262
return AlertWithOneAction(
@@ -270,7 +271,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
271
272
if (state is TransactionCreatedSuccessfully) {
273
WidgetsBinding.instance.addPostFrameCallback((_) {
273
- showDialog<void>(
274
+ showPopUp<void>(
275
context: context,
276
builder: (BuildContext context) {
277
return AlertWithTwoActions(
@@ -292,7 +293,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
293
294
if (state is TransactionCommitted) {
295
WidgetsBinding.instance.addPostFrameCallback((_) {
295
- showDialog<void>(
296
+ showPopUp<void>(
297
context: context,
298
builder: (BuildContext context) {
299
return AlertWithOneAction(
lib/src/screens/new_wallet/new_wallet_page.dart
+2
-1
@@ -1,6 +1,7 @@
1
import 'package:cake_wallet/di.dart';
2
import 'package:cake_wallet/routes.dart';
3
import 'package:cake_wallet/store/settings_store.dart';
4
+import 'package:cake_wallet/utils/show_pop_up.dart';
5
import 'package:mobx/mobx.dart';
6
import 'package:flutter_mobx/flutter_mobx.dart';
7
import 'package:flutter/material.dart';
@@ -60,7 +61,7 @@ class _WalletNameFormState extends State<WalletNameForm> {
61
62
if (state is FailureState) {
63
WidgetsBinding.instance.addPostFrameCallback((_) {
63
- showDialog<void>(
64
+ showPopUp<void>(
65
context: context,
66
builder: (_) {
67
return AlertWithOneAction(
lib/src/screens/nodes/nodes_list_page.dart
+4
-3
@@ -1,3 +1,4 @@
1
+import 'package:cake_wallet/utils/show_pop_up.dart';
2
import 'package:flutter/material.dart';
3
import 'package:flutter/cupertino.dart';
4
import 'package:flutter_mobx/flutter_mobx.dart';
@@ -29,7 +30,7 @@ class NodeListPage extends BasePage {
30
minWidth: double.minPositive,
31
child: FlatButton(
32
onPressed: () async {
32
- await showDialog<void>(
33
+ await showPopUp<void>(
34
context: context,
35
builder: (BuildContext context) {
36
return AlertWithTwoActions(
@@ -83,7 +84,7 @@ class NodeListPage extends BasePage {
84
return;
85
}
86
86
- await showDialog<void>(
87
+ await showPopUp<void>(
88
context: context,
89
builder: (BuildContext context) {
90
return AlertDialog(
@@ -110,7 +111,7 @@ class NodeListPage extends BasePage {
111
final dismissibleRow = Dismissible(
112
key: Key('${node.keyIndex}'),
113
confirmDismiss: (direction) async {
113
- return await showDialog(
114
+ return await showPopUp(
115
context: context,
116
builder: (BuildContext context) {
117
return AlertWithTwoActions(
lib/src/screens/pin_code/pin_code_widget.dart
+1
-1
@@ -266,7 +266,7 @@ class PinCodeState<T extends PinCodeWidget> extends State<T> {
266
return;
267
}
268
269
- pin.substring(0, pin.length - 1);
269
+ setState(() => pin = pin.substring(0, pin.length - 1));
270
}
271
272
String _changePinLengthText() {
lib/src/screens/receive/receive_page.dart
+44
-41
@@ -1,3 +1,4 @@
1
+import 'package:cake_wallet/utils/show_pop_up.dart';
2
import 'package:flutter/material.dart';
3
import 'package:flutter/cupertino.dart';
4
import 'package:flutter_mobx/flutter_mobx.dart';
@@ -34,21 +35,19 @@ class ReceivePage extends BasePage {
35
36
@override
37
Widget Function(BuildContext, Widget) get rootWrapper =>
37
- (BuildContext context, Widget scaffold) => Container(
38
+ (BuildContext context, Widget scaffold) => Container(
39
decoration: BoxDecoration(
40
gradient: LinearGradient(colors: [
40
- Theme.of(context).accentColor,
41
- Theme.of(context).scaffoldBackgroundColor,
42
- Theme.of(context).primaryColor,
43
- ],
44
- begin: Alignment.topRight,
45
- end: Alignment.bottomLeft)),
41
+ Theme.of(context).accentColor,
42
+ Theme.of(context).scaffoldBackgroundColor,
43
+ Theme.of(context).primaryColor,
44
+ ], begin: Alignment.topRight, end: Alignment.bottomLeft)),
45
child: scaffold);
46
47
@override
48
Widget trailing(BuildContext context) {
50
- final shareImage = Image.asset('assets/images/share.png',
51
- color: Colors.white);
49
+ final shareImage =
50
+ Image.asset('assets/images/share.png', color: Colors.white);
51
52
return SizedBox(
53
height: 20.0,
@@ -56,12 +55,12 @@ class ReceivePage extends BasePage {
55
child: ButtonTheme(
56
minWidth: double.minPositive,
57
child: FlatButton(
59
- highlightColor: Colors.transparent,
60
- splashColor: Colors.transparent,
61
- padding: EdgeInsets.all(0),
62
- onPressed: () => Share.text(S.current.share_address,
63
- addressListViewModel.address.address, 'text/plain'),
64
- child: shareImage),
58
+ highlightColor: Colors.transparent,
59
+ splashColor: Colors.transparent,
60
+ padding: EdgeInsets.all(0),
61
+ onPressed: () => Share.text(S.current.share_address,
62
+ addressListViewModel.address.address, 'text/plain'),
63
+ child: shareImage),
64
),
65
);
66
}
@@ -80,10 +79,9 @@ class ReceivePage extends BasePage {
79
),
80
Observer(
81
builder: (_) => ListView.separated(
83
- separatorBuilder: (context, _) =>
84
- Container(
85
- height: 1,
86
- color: Theme.of(context).dividerColor),
82
+ padding: EdgeInsets.all(0),
83
+ separatorBuilder: (context, _) => Container(
84
+ height: 1, color: Theme.of(context).dividerColor),
85
shrinkWrap: true,
86
physics: NeverScrollableScrollPhysics(),
87
itemCount: addressListViewModel.items.length,
@@ -93,9 +91,10 @@ class ReceivePage extends BasePage {
91
92
if (item is WalletAccountListHeader) {
93
cell = HeaderTile(
96
- onTap: () async => await showDialog<void>(
94
+ onTap: () async => await showPopUp<void>(
95
context: context,
98
- builder: (_) => getIt.get<MoneroAccountListPage>()),
96
+ builder: (_) =>
97
+ getIt.get<MoneroAccountListPage>()),
98
title: addressListViewModel.accountLabel,
99
icon: Icon(
100
Icons.arrow_forward_ios,
@@ -117,27 +116,31 @@ class ReceivePage extends BasePage {
116
}
117
118
if (item is WalletAddressListItem) {
120
- cell = Observer(
121
- builder: (_) {
122
- final isCurrent = item.address ==
123
- addressListViewModel.address.address;
124
- final backgroundColor = isCurrent
125
- ? Theme.of(context).textTheme.display3.decorationColor
126
- : Theme.of(context).textTheme.display2.decorationColor;
127
- final textColor = isCurrent
128
- ? Theme.of(context).textTheme.display3.color
129
- : Theme.of(context).textTheme.display2.color;
119
+ cell = Observer(builder: (_) {
120
+ final isCurrent = item.address ==
121
+ addressListViewModel.address.address;
122
+ final backgroundColor = isCurrent
123
+ ? Theme.of(context)
124
+ .textTheme
125
+ .display3
126
+ .decorationColor
127
+ : Theme.of(context)
128
+ .textTheme
129
+ .display2
130
+ .decorationColor;
131
+ final textColor = isCurrent
132
+ ? Theme.of(context).textTheme.display3.color
133
+ : Theme.of(context).textTheme.display2.color;
134
131
- return AddressCell.fromItem(item,
132
- isCurrent: isCurrent,
133
- backgroundColor: backgroundColor,
134
- textColor: textColor,
135
- onTap: (_) => addressListViewModel.address = item,
136
- onEdit: () => Navigator.of(context).pushNamed(
137
- Routes.newSubaddress,
138
- arguments: item));
139
- }
140
- );
135
+ return AddressCell.fromItem(item,
136
+ isCurrent: isCurrent,
137
+ backgroundColor: backgroundColor,
138
+ textColor: textColor,
139
+ onTap: (_) => addressListViewModel.address = item,
140
+ onEdit: () => Navigator.of(context).pushNamed(
141
+ Routes.newSubaddress,
142
+ arguments: item));
143
+ });
144
}
145
146
return index != 0
lib/src/screens/restore/restore_wallet_from_keys_page.dart
+1
-1
@@ -80,7 +80,7 @@ class _RestoreFromKeysFromState extends State<RestoreFromKeysFrom> {
80
81
if (state is WalletRestorationFailure) {
82
WidgetsBinding.instance.addPostFrameCallback((_) {
83
- showDialog<void>(
83
+ showPopUp<void>(
84
context: context,
85
builder: (BuildContext context) {
86
return AlertWithOneAction(
lib/src/screens/restore/restore_wallet_from_seed_details.dart
+2
-1
@@ -1,3 +1,4 @@
1
+import 'package:cake_wallet/utils/show_pop_up.dart';
2
import 'package:mobx/mobx.dart';
3
import 'package:flutter/material.dart';
4
import 'package:flutter_mobx/flutter_mobx.dart';
@@ -53,7 +54,7 @@ class _RestoreFromSeedDetailsFormState
54
55
if (state is FailureState) {
56
WidgetsBinding.instance.addPostFrameCallback((_) {
56
- showDialog<void>(
57
+ showPopUp<void>(
58
context: context,
59
builder: (BuildContext context) {
60
return AlertWithOneAction(
lib/src/screens/seed/wallet_seed_page.dart
+4
-3
@@ -2,6 +2,7 @@ import 'package:cake_wallet/di.dart';
2
import 'package:cake_wallet/palette.dart';
3
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
4
import 'package:cake_wallet/store/settings_store.dart';
5
+import 'package:cake_wallet/utils/show_pop_up.dart';
6
import 'package:flutter/cupertino.dart';
7
import 'package:flutter/material.dart';
8
import 'package:flutter/services.dart';
@@ -27,12 +28,12 @@ class WalletSeedPage extends BasePage {
28
@override
29
void onClose(BuildContext context) async {
30
if (isNewWalletCreated) {
30
- final confirmed = await showDialog<bool>(context: context, builder: (BuildContext context) {
31
+ final confirmed = await showPopUp<bool>(context: context, builder: (BuildContext context) {
32
// FIXME: add translations
33
return AlertWithTwoActions(
34
alertTitle: 'Attention',
34
- alertContent: 'Have you written it down? The seed is the only way to recover your wallet.',
35
- leftButtonText: 'Not yet',
35
+ alertContent: 'The seed is the only way to recover your wallet. Have you written it down?',
36
+ leftButtonText: 'Go back',
37
rightButtonText: 'Yes, I have',
38
actionLeftButton: () => Navigator.of(context).pop(false),
39
actionRightButton: () => Navigator.of(context).pop(true));
lib/src/screens/send/send_page.dart
+7
-6
@@ -6,6 +6,7 @@ import 'package:cake_wallet/src/widgets/picker.dart';
6
import 'package:cake_wallet/src/widgets/primary_button.dart';
7
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
8
import 'package:cake_wallet/src/widgets/trail_button.dart';
9
+import 'package:cake_wallet/utils/show_pop_up.dart';
10
import 'package:cake_wallet/view_model/send/send_view_model_state.dart';
11
import 'package:flutter/cupertino.dart';
12
import 'package:flutter/material.dart';
@@ -397,7 +398,7 @@ class SendPage extends BasePage {
398
// getOpenaliasRecord(context);
399
// },
400
// onRemove: () {
400
- // showDialog<void>(
401
+ // showPopUp<void>(
402
// context: context,
403
// builder: (dialogContext) {
404
// return AlertWithTwoActions(
@@ -492,7 +493,7 @@ class SendPage extends BasePage {
493
reaction((_) => sendViewModel.state, (ExecutionState state) {
494
if (state is FailureState) {
495
WidgetsBinding.instance.addPostFrameCallback((_) {
495
- showDialog<void>(
496
+ showPopUp<void>(
497
context: context,
498
builder: (BuildContext context) {
499
return AlertWithOneAction(
@@ -506,7 +507,7 @@ class SendPage extends BasePage {
507
508
if (state is ExecutedSuccessfullyState) {
509
WidgetsBinding.instance.addPostFrameCallback((_) {
509
- showDialog<void>(
510
+ showPopUp<void>(
511
context: context,
512
builder: (BuildContext context) {
513
return ConfirmSendingAlert(
@@ -521,7 +522,7 @@ class SendPage extends BasePage {
522
actionLeftButton: () {
523
Navigator.of(context).pop();
524
sendViewModel.commitTransaction();
524
- showDialog<void>(
525
+ showPopUp<void>(
526
context: context,
527
builder: (BuildContext context) {
528
return Observer(builder: (_) {
@@ -635,7 +636,7 @@ class SendPage extends BasePage {
636
// if (isOpenalias) {
637
// _addressController.text = sendViewModel.recordAddress;
638
638
- // await showDialog<void>(
639
+ // await showPopUp<void>(
640
// context: context,
641
// builder: (BuildContext context) {
642
// return AlertWithOneAction(
@@ -653,7 +654,7 @@ class SendPage extends BasePage {
654
// final items = TransactionPriority.all;
655
// final selectedItem = items.indexOf(sendViewModel.transactionPriority);
656
//
656
- // await showDialog<void>(
657
+ // await showPopUp<void>(
658
// builder: (_) => Picker(
659
// items: items,
660
// selectedAtIndex: selectedItem,
lib/src/screens/settings/change_language.dart
+1
-1
@@ -39,7 +39,7 @@ class ChangeLanguage extends BasePage {
39
// isSelected: isCurrent,
40
// handler: (context) async {
41
// if (!isCurrent) {
42
- // await showDialog<void>(
42
+ // await showPopUp<void>(
43
// context: context,
44
// builder: (BuildContext context) {
45
// return AlertWithTwoActions(
lib/src/screens/settings/widgets/settings_picker_cell.dart
+2
-1
@@ -1,3 +1,4 @@
1
+import 'package:cake_wallet/utils/show_pop_up.dart';
2
import 'package:flutter/material.dart';
3
import 'package:cake_wallet/src/widgets/picker.dart';
4
import 'package:cake_wallet/src/widgets/standard_list.dart';
@@ -16,7 +17,7 @@ class SettingsPickerCell<ItemType> extends StandardListRow {
17
onTap: (BuildContext context) async {
18
final selectedAtIndex = items.indexOf(selectedItem);
19
19
- await showDialog<void>(
20
+ await showPopUp<void>(
21
context: context,
22
builder: (_) => Picker(
23
items: items,
lib/src/screens/setup_pin_code/setup_pin_code.dart
+4
-3
@@ -1,3 +1,4 @@
1
+import 'package:cake_wallet/utils/show_pop_up.dart';
2
import 'package:flutter/material.dart';
3
import 'package:flutter/cupertino.dart';
4
import 'package:cake_wallet/generated/i18n.dart';
@@ -26,7 +27,7 @@ class SetupPinCodePage extends BasePage {
27
}
28
29
if (!pinCodeViewModel.isPinCodeCorrect) {
29
- await showDialog<void>(
30
+ await showPopUp<void>(
31
context: context,
32
builder: (BuildContext context) {
33
return AlertWithOneAction(
@@ -43,7 +44,7 @@ class SetupPinCodePage extends BasePage {
44
try {
45
await pinCodeViewModel.setupPinCode();
46
46
- await showDialog<void>(
47
+ await showPopUp<void>(
48
context: context,
49
builder: (BuildContext context) {
50
return AlertWithOneAction(
@@ -60,7 +61,7 @@ class SetupPinCodePage extends BasePage {
61
});
62
} catch (e) {
63
// FIXME: Add translation for alert content text.
63
- await showDialog<void>(
64
+ await showPopUp<void>(
65
context: context,
66
builder: (BuildContext context) {
67
return AlertWithOneAction(
lib/src/screens/wallet_list/wallet_menu.dart
+2
-1
@@ -1,4 +1,5 @@
1
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
2
+import 'package:cake_wallet/utils/show_pop_up.dart';
3
import 'package:cake_wallet/view_model/wallet_list/wallet_list_view_model.dart';
4
import 'package:flutter/material.dart';
5
import 'package:cake_wallet/routes.dart';
@@ -126,7 +127,7 @@ class WalletMenu {
127
});
128
break;
129
case 2:
129
- final isComfirmed = await showDialog<bool>(
130
+ final isComfirmed = await showPopUp<bool>(
131
context: context,
132
builder: (BuildContext context) {
133
return AlertWithTwoActions(
lib/src/widgets/seed_language_selector.dart
+2
-1
@@ -1,3 +1,4 @@
1
+import 'package:cake_wallet/utils/show_pop_up.dart';
2
import 'package:flutter/material.dart';
3
import 'package:cake_wallet/generated/i18n.dart';
4
import 'package:cake_wallet/src/screens/new_wallet/widgets/select_button.dart';
@@ -35,7 +36,7 @@ class SeedLanguageSelectorState extends State<SeedLanguageSelector> {
36
image: null,
37
text: seedLocales[seedLanguages.indexOf(selected)],
38
onTap: () async {
38
- final selected = await showDialog<String>(
39
+ final selected = await showPopUp<String>(
40
context: context,
41
builder: (BuildContext context) =>
42
SeedLanguagePicker(key: _pickerKey, selected: this.selected));
lib/utils/show_pop_up.dart
new
+22
@@ -0,0 +1,22 @@
1
+import 'package:flutter/material.dart';
2
+
3
+Future<T> showPopUp<T>({
4
+ @required BuildContext context,
5
+ WidgetBuilder builder,
6
+ bool barrierDismissible = true,
7
+ Color barrierColor,
8
+ bool useSafeArea = false,
9
+ bool useRootNavigator = true,
10
+ RouteSettings routeSettings,
11
+ Widget child,
12
+}) {
13
+ return showDialog<T>(
14
+ context: context,
15
+ builder: builder,
16
+ barrierDismissible: barrierDismissible,
17
+ barrierColor: barrierColor,
18
+ useSafeArea: useSafeArea,
19
+ useRootNavigator: useRootNavigator,
20
+ routeSettings: routeSettings,
21
+ child: child);
22
+}
lib/view_model/wallet_list/wallet_list_view_model.dart
+1
-1
@@ -35,7 +35,7 @@ abstract class WalletListViewModelBase with Store {
35
36
@action
37
Future<void> remove(WalletListItem wallet) async {
38
- final walletService = getIt.get<WalletService>();
38
+ final walletService = getIt.get<WalletService>(param1: wallet.type);
39
await walletService.remove(wallet.name);
40
await _walletInfoSource.delete(wallet.key);
41
_updateList();