Fixes pre release.

This commit is contained in:
M 2020-09-25 18:32:44 +03:00
parent dcbaf01118
commit 34aa7fdc76
25 changed files with 124 additions and 81 deletions

View file

@ -191,7 +191,7 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance> with Store {
@override @override
Future<void> rescan({int height}) async { Future<void> rescan({int height}) async {
// FIXME: Unimplemented monero_wallet.rescanBlockchainAsync();
} }
void _setListeners() { void _setListeners() {

View file

@ -1,3 +1,4 @@
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -246,7 +247,7 @@ class ContactListPage extends BasePage {
} }
Future<bool> showAlertDialog(BuildContext context) async { Future<bool> showAlertDialog(BuildContext context) async {
return await showDialog( return await showPopUp(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertWithTwoActions( return AlertWithTwoActions(
@ -261,7 +262,7 @@ class ContactListPage extends BasePage {
Future<bool> showNameAndAddressDialog( Future<bool> showNameAndAddressDialog(
BuildContext context, String name, String address) async { BuildContext context, String name, String address) async {
return await showDialog( return await showPopUp(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertWithTwoActions( return AlertWithTwoActions(

View file

@ -1,4 +1,5 @@
import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:flutter_mobx/flutter_mobx.dart';
@ -138,7 +139,7 @@ class ContactPage extends BasePage {
} }
void _presentCurrencyPicker(BuildContext context) { void _presentCurrencyPicker(BuildContext context) {
showDialog<void>( showPopUp<void>(
builder: (_) => CurrencyPicker( builder: (_) => CurrencyPicker(
selectedAtIndex: selectedAtIndex:
contactViewModel.currencies.indexOf(contactViewModel.currency), contactViewModel.currencies.indexOf(contactViewModel.currency),
@ -150,7 +151,7 @@ class ContactPage extends BasePage {
} }
void _onContactSavingFailure(BuildContext context, String error) { void _onContactSavingFailure(BuildContext context, String error) {
showDialog<void>( showPopUp<void>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertWithOneAction( return AlertWithOneAction(

View file

@ -1,3 +1,4 @@
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/routes.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -72,7 +73,7 @@ class WalletMenu {
} }
Future<void> _presentReconnectAlert(BuildContext context) async { Future<void> _presentReconnectAlert(BuildContext context) async {
await showDialog<void>( await showPopUp<void>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertWithTwoActions( return AlertWithTwoActions(

View file

@ -1,4 +1,5 @@
import 'package:cake_wallet/src/screens/dashboard/widgets/filter_widget.dart'; import 'package:cake_wallet/src/screens/dashboard/widgets/filter_widget.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart'; import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
@ -31,7 +32,7 @@ class HeaderRow extends StatelessWidget {
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
showDialog<void>( showPopUp<void>(
context: context, context: context,
builder: (context) => FilterWidget(dashboardViewModel: dashboardViewModel) builder: (context) => FilterWidget(dashboardViewModel: dashboardViewModel)
); );

View file

@ -1,5 +1,6 @@
import 'dart:ui'; import 'dart:ui';
import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -51,7 +52,7 @@ class DisclaimerBodyState extends State<DisclaimerPageBody> {
} }
Future<void> _showAlertDialog(BuildContext context) async { Future<void> _showAlertDialog(BuildContext context) async {
await showDialog<void>( await showPopUp<void>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertWithOneAction( return AlertWithOneAction(

View file

@ -4,6 +4,7 @@ import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart'; import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
import 'package:cake_wallet/src/widgets/template_tile.dart'; import 'package:cake_wallet/src/widgets/template_tile.dart';
import 'package:cake_wallet/src/widgets/trail_button.dart'; import 'package:cake_wallet/src/widgets/trail_button.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:dotted_border/dotted_border.dart'; import 'package:dotted_border/dotted_border.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -293,7 +294,7 @@ class ExchangePage extends BasePage {
exchangeViewModel, template); exchangeViewModel, template);
}, },
onRemove: () { onRemove: () {
showDialog<void>( showPopUp<void>(
context: context, context: context,
builder: (dialogContext) { builder: (dialogContext) {
return AlertWithTwoActions( return AlertWithTwoActions(
@ -492,7 +493,7 @@ class ExchangePage extends BasePage {
// reaction((_) => exchangeViewModel.tradeState, (ExchangeTradeState state) { // reaction((_) => exchangeViewModel.tradeState, (ExchangeTradeState state) {
// if (state is TradeIsCreatedFailure) { // if (state is TradeIsCreatedFailure) {
// WidgetsBinding.instance.addPostFrameCallback((_) { // WidgetsBinding.instance.addPostFrameCallback((_) {
// showDialog<void>( // showPopUp<void>(
// context: context, // context: context,
// builder: (BuildContext context) { // builder: (BuildContext context) {
// return AlertWithOneAction( // return AlertWithOneAction(

View file

@ -1,3 +1,4 @@
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/generated/i18n.dart';
@ -303,7 +304,7 @@ class ExchangeCardState extends State<ExchangeCard> {
} }
void _presentPicker(BuildContext context) { void _presentPicker(BuildContext context) {
showDialog<void>( showPopUp<void>(
builder: (_) => CurrencyPicker( builder: (_) => CurrencyPicker(
selectedAtIndex: widget.currencies.indexOf(_selectedCurrency), selectedAtIndex: widget.currencies.indexOf(_selectedCurrency),
items: widget.currencies, items: widget.currencies,

View file

@ -1,3 +1,4 @@
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/exchange/exchange_provider_description.dart'; import 'package:cake_wallet/exchange/exchange_provider_description.dart';
import 'package:cake_wallet/exchange/exchange_provider.dart'; import 'package:cake_wallet/exchange/exchange_provider.dart';
@ -72,7 +73,7 @@ class PresentProviderPicker extends StatelessWidget {
} }
} }
showDialog<void>( showPopUp<void>(
builder: (_) => Picker( builder: (_) => Picker(
items: items, items: items,
images: images, images: images,

View file

@ -4,6 +4,7 @@ import 'package:cake_wallet/exchange/exchange_provider_description.dart';
import 'package:cake_wallet/src/screens/exchange_trade/exchange_trade_item.dart'; import 'package:cake_wallet/src/screens/exchange_trade/exchange_trade_item.dart';
import 'package:cake_wallet/src/screens/exchange_trade/information_page.dart'; import 'package:cake_wallet/src/screens/exchange_trade/information_page.dart';
import 'package:cake_wallet/src/widgets/standart_list_row.dart'; import 'package:cake_wallet/src/widgets/standart_list_row.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:cake_wallet/view_model/exchange/exchange_trade_view_model.dart'; import 'package:cake_wallet/view_model/exchange/exchange_trade_view_model.dart';
import 'package:mobx/mobx.dart'; import 'package:mobx/mobx.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -37,7 +38,7 @@ void showInformation(ExchangeTradeViewModel exchangeTradeViewModel, BuildContext
: S.current.exchange_result_description( : S.current.exchange_result_description(
trade.amount ?? fetchingLabel, trade.from.toString()); trade.amount ?? fetchingLabel, trade.from.toString());
showDialog<void>( showPopUp<void>(
context: context, context: context,
builder: (_) => InformationPage(information: information) builder: (_) => InformationPage(information: information)
); );
@ -255,7 +256,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
reaction((_) => sendStore.state, (SendingState state) { reaction((_) => sendStore.state, (SendingState state) {
if (state is SendingFailed) { if (state is SendingFailed) {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
showDialog<void>( showPopUp<void>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertWithOneAction( return AlertWithOneAction(
@ -270,7 +271,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
if (state is TransactionCreatedSuccessfully) { if (state is TransactionCreatedSuccessfully) {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
showDialog<void>( showPopUp<void>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertWithTwoActions( return AlertWithTwoActions(
@ -292,7 +293,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
if (state is TransactionCommitted) { if (state is TransactionCommitted) {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
showDialog<void>( showPopUp<void>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertWithOneAction( return AlertWithOneAction(

View file

@ -1,6 +1,7 @@
import 'package:cake_wallet/di.dart'; import 'package:cake_wallet/di.dart';
import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/store/settings_store.dart'; import 'package:cake_wallet/store/settings_store.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:mobx/mobx.dart'; import 'package:mobx/mobx.dart';
import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -60,7 +61,7 @@ class _WalletNameFormState extends State<WalletNameForm> {
if (state is FailureState) { if (state is FailureState) {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
showDialog<void>( showPopUp<void>(
context: context, context: context,
builder: (_) { builder: (_) {
return AlertWithOneAction( return AlertWithOneAction(

View file

@ -1,3 +1,4 @@
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:flutter_mobx/flutter_mobx.dart';
@ -29,7 +30,7 @@ class NodeListPage extends BasePage {
minWidth: double.minPositive, minWidth: double.minPositive,
child: FlatButton( child: FlatButton(
onPressed: () async { onPressed: () async {
await showDialog<void>( await showPopUp<void>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertWithTwoActions( return AlertWithTwoActions(
@ -83,7 +84,7 @@ class NodeListPage extends BasePage {
return; return;
} }
await showDialog<void>( await showPopUp<void>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertDialog( return AlertDialog(
@ -110,7 +111,7 @@ class NodeListPage extends BasePage {
final dismissibleRow = Dismissible( final dismissibleRow = Dismissible(
key: Key('${node.keyIndex}'), key: Key('${node.keyIndex}'),
confirmDismiss: (direction) async { confirmDismiss: (direction) async {
return await showDialog( return await showPopUp(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertWithTwoActions( return AlertWithTwoActions(

View file

@ -266,7 +266,7 @@ class PinCodeState<T extends PinCodeWidget> extends State<T> {
return; return;
} }
pin.substring(0, pin.length - 1); setState(() => pin = pin.substring(0, pin.length - 1));
} }
String _changePinLengthText() { String _changePinLengthText() {

View file

@ -1,3 +1,4 @@
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:flutter_mobx/flutter_mobx.dart';
@ -34,21 +35,19 @@ class ReceivePage extends BasePage {
@override @override
Widget Function(BuildContext, Widget) get rootWrapper => Widget Function(BuildContext, Widget) get rootWrapper =>
(BuildContext context, Widget scaffold) => Container( (BuildContext context, Widget scaffold) => Container(
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: LinearGradient(colors: [ gradient: LinearGradient(colors: [
Theme.of(context).accentColor, Theme.of(context).accentColor,
Theme.of(context).scaffoldBackgroundColor, Theme.of(context).scaffoldBackgroundColor,
Theme.of(context).primaryColor, Theme.of(context).primaryColor,
], ], begin: Alignment.topRight, end: Alignment.bottomLeft)),
begin: Alignment.topRight,
end: Alignment.bottomLeft)),
child: scaffold); child: scaffold);
@override @override
Widget trailing(BuildContext context) { Widget trailing(BuildContext context) {
final shareImage = Image.asset('assets/images/share.png', final shareImage =
color: Colors.white); Image.asset('assets/images/share.png', color: Colors.white);
return SizedBox( return SizedBox(
height: 20.0, height: 20.0,
@ -56,12 +55,12 @@ class ReceivePage extends BasePage {
child: ButtonTheme( child: ButtonTheme(
minWidth: double.minPositive, minWidth: double.minPositive,
child: FlatButton( child: FlatButton(
highlightColor: Colors.transparent, highlightColor: Colors.transparent,
splashColor: Colors.transparent, splashColor: Colors.transparent,
padding: EdgeInsets.all(0), padding: EdgeInsets.all(0),
onPressed: () => Share.text(S.current.share_address, onPressed: () => Share.text(S.current.share_address,
addressListViewModel.address.address, 'text/plain'), addressListViewModel.address.address, 'text/plain'),
child: shareImage), child: shareImage),
), ),
); );
} }
@ -80,10 +79,9 @@ class ReceivePage extends BasePage {
), ),
Observer( Observer(
builder: (_) => ListView.separated( builder: (_) => ListView.separated(
separatorBuilder: (context, _) => padding: EdgeInsets.all(0),
Container( separatorBuilder: (context, _) => Container(
height: 1, height: 1, color: Theme.of(context).dividerColor),
color: Theme.of(context).dividerColor),
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
itemCount: addressListViewModel.items.length, itemCount: addressListViewModel.items.length,
@ -93,9 +91,10 @@ class ReceivePage extends BasePage {
if (item is WalletAccountListHeader) { if (item is WalletAccountListHeader) {
cell = HeaderTile( cell = HeaderTile(
onTap: () async => await showDialog<void>( onTap: () async => await showPopUp<void>(
context: context, context: context,
builder: (_) => getIt.get<MoneroAccountListPage>()), builder: (_) =>
getIt.get<MoneroAccountListPage>()),
title: addressListViewModel.accountLabel, title: addressListViewModel.accountLabel,
icon: Icon( icon: Icon(
Icons.arrow_forward_ios, Icons.arrow_forward_ios,
@ -117,27 +116,31 @@ class ReceivePage extends BasePage {
} }
if (item is WalletAddressListItem) { if (item is WalletAddressListItem) {
cell = Observer( cell = Observer(builder: (_) {
builder: (_) { final isCurrent = item.address ==
final isCurrent = item.address == addressListViewModel.address.address;
addressListViewModel.address.address; final backgroundColor = isCurrent
final backgroundColor = isCurrent ? Theme.of(context)
? Theme.of(context).textTheme.display3.decorationColor .textTheme
: Theme.of(context).textTheme.display2.decorationColor; .display3
final textColor = isCurrent .decorationColor
? Theme.of(context).textTheme.display3.color : Theme.of(context)
: Theme.of(context).textTheme.display2.color; .textTheme
.display2
.decorationColor;
final textColor = isCurrent
? Theme.of(context).textTheme.display3.color
: Theme.of(context).textTheme.display2.color;
return AddressCell.fromItem(item, return AddressCell.fromItem(item,
isCurrent: isCurrent, isCurrent: isCurrent,
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
textColor: textColor, textColor: textColor,
onTap: (_) => addressListViewModel.address = item, onTap: (_) => addressListViewModel.address = item,
onEdit: () => Navigator.of(context).pushNamed( onEdit: () => Navigator.of(context).pushNamed(
Routes.newSubaddress, Routes.newSubaddress,
arguments: item)); arguments: item));
} });
);
} }
return index != 0 return index != 0

View file

@ -80,7 +80,7 @@ class _RestoreFromKeysFromState extends State<RestoreFromKeysFrom> {
if (state is WalletRestorationFailure) { if (state is WalletRestorationFailure) {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
showDialog<void>( showPopUp<void>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertWithOneAction( return AlertWithOneAction(

View file

@ -1,3 +1,4 @@
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:mobx/mobx.dart'; import 'package:mobx/mobx.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:flutter_mobx/flutter_mobx.dart';
@ -53,7 +54,7 @@ class _RestoreFromSeedDetailsFormState
if (state is FailureState) { if (state is FailureState) {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
showDialog<void>( showPopUp<void>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertWithOneAction( return AlertWithOneAction(

View file

@ -2,6 +2,7 @@ import 'package:cake_wallet/di.dart';
import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart'; import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
import 'package:cake_wallet/store/settings_store.dart'; import 'package:cake_wallet/store/settings_store.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -27,12 +28,12 @@ class WalletSeedPage extends BasePage {
@override @override
void onClose(BuildContext context) async { void onClose(BuildContext context) async {
if (isNewWalletCreated) { if (isNewWalletCreated) {
final confirmed = await showDialog<bool>(context: context, builder: (BuildContext context) { final confirmed = await showPopUp<bool>(context: context, builder: (BuildContext context) {
// FIXME: add translations // FIXME: add translations
return AlertWithTwoActions( return AlertWithTwoActions(
alertTitle: 'Attention', alertTitle: 'Attention',
alertContent: 'Have you written it down? The seed is the only way to recover your wallet.', alertContent: 'The seed is the only way to recover your wallet. Have you written it down?',
leftButtonText: 'Not yet', leftButtonText: 'Go back',
rightButtonText: 'Yes, I have', rightButtonText: 'Yes, I have',
actionLeftButton: () => Navigator.of(context).pop(false), actionLeftButton: () => Navigator.of(context).pop(false),
actionRightButton: () => Navigator.of(context).pop(true)); actionRightButton: () => Navigator.of(context).pop(true));

View file

@ -6,6 +6,7 @@ import 'package:cake_wallet/src/widgets/picker.dart';
import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart';
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart'; import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
import 'package:cake_wallet/src/widgets/trail_button.dart'; import 'package:cake_wallet/src/widgets/trail_button.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:cake_wallet/view_model/send/send_view_model_state.dart'; import 'package:cake_wallet/view_model/send/send_view_model_state.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -397,7 +398,7 @@ class SendPage extends BasePage {
// getOpenaliasRecord(context); // getOpenaliasRecord(context);
// }, // },
// onRemove: () { // onRemove: () {
// showDialog<void>( // showPopUp<void>(
// context: context, // context: context,
// builder: (dialogContext) { // builder: (dialogContext) {
// return AlertWithTwoActions( // return AlertWithTwoActions(
@ -492,7 +493,7 @@ class SendPage extends BasePage {
reaction((_) => sendViewModel.state, (ExecutionState state) { reaction((_) => sendViewModel.state, (ExecutionState state) {
if (state is FailureState) { if (state is FailureState) {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
showDialog<void>( showPopUp<void>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertWithOneAction( return AlertWithOneAction(
@ -506,7 +507,7 @@ class SendPage extends BasePage {
if (state is ExecutedSuccessfullyState) { if (state is ExecutedSuccessfullyState) {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
showDialog<void>( showPopUp<void>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return ConfirmSendingAlert( return ConfirmSendingAlert(
@ -521,7 +522,7 @@ class SendPage extends BasePage {
actionLeftButton: () { actionLeftButton: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
sendViewModel.commitTransaction(); sendViewModel.commitTransaction();
showDialog<void>( showPopUp<void>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return Observer(builder: (_) { return Observer(builder: (_) {
@ -635,7 +636,7 @@ class SendPage extends BasePage {
// if (isOpenalias) { // if (isOpenalias) {
// _addressController.text = sendViewModel.recordAddress; // _addressController.text = sendViewModel.recordAddress;
// await showDialog<void>( // await showPopUp<void>(
// context: context, // context: context,
// builder: (BuildContext context) { // builder: (BuildContext context) {
// return AlertWithOneAction( // return AlertWithOneAction(
@ -653,7 +654,7 @@ class SendPage extends BasePage {
// final items = TransactionPriority.all; // final items = TransactionPriority.all;
// final selectedItem = items.indexOf(sendViewModel.transactionPriority); // final selectedItem = items.indexOf(sendViewModel.transactionPriority);
// //
// await showDialog<void>( // await showPopUp<void>(
// builder: (_) => Picker( // builder: (_) => Picker(
// items: items, // items: items,
// selectedAtIndex: selectedItem, // selectedAtIndex: selectedItem,

View file

@ -39,7 +39,7 @@ class ChangeLanguage extends BasePage {
// isSelected: isCurrent, // isSelected: isCurrent,
// handler: (context) async { // handler: (context) async {
// if (!isCurrent) { // if (!isCurrent) {
// await showDialog<void>( // await showPopUp<void>(
// context: context, // context: context,
// builder: (BuildContext context) { // builder: (BuildContext context) {
// return AlertWithTwoActions( // return AlertWithTwoActions(

View file

@ -1,3 +1,4 @@
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/src/widgets/picker.dart'; import 'package:cake_wallet/src/widgets/picker.dart';
import 'package:cake_wallet/src/widgets/standard_list.dart'; import 'package:cake_wallet/src/widgets/standard_list.dart';
@ -16,7 +17,7 @@ class SettingsPickerCell<ItemType> extends StandardListRow {
onTap: (BuildContext context) async { onTap: (BuildContext context) async {
final selectedAtIndex = items.indexOf(selectedItem); final selectedAtIndex = items.indexOf(selectedItem);
await showDialog<void>( await showPopUp<void>(
context: context, context: context,
builder: (_) => Picker( builder: (_) => Picker(
items: items, items: items,

View file

@ -1,3 +1,4 @@
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/generated/i18n.dart';
@ -26,7 +27,7 @@ class SetupPinCodePage extends BasePage {
} }
if (!pinCodeViewModel.isPinCodeCorrect) { if (!pinCodeViewModel.isPinCodeCorrect) {
await showDialog<void>( await showPopUp<void>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertWithOneAction( return AlertWithOneAction(
@ -43,7 +44,7 @@ class SetupPinCodePage extends BasePage {
try { try {
await pinCodeViewModel.setupPinCode(); await pinCodeViewModel.setupPinCode();
await showDialog<void>( await showPopUp<void>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertWithOneAction( return AlertWithOneAction(
@ -60,7 +61,7 @@ class SetupPinCodePage extends BasePage {
}); });
} catch (e) { } catch (e) {
// FIXME: Add translation for alert content text. // FIXME: Add translation for alert content text.
await showDialog<void>( await showPopUp<void>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertWithOneAction( return AlertWithOneAction(

View file

@ -1,4 +1,5 @@
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart'; import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:cake_wallet/view_model/wallet_list/wallet_list_view_model.dart'; import 'package:cake_wallet/view_model/wallet_list/wallet_list_view_model.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/routes.dart';
@ -126,7 +127,7 @@ class WalletMenu {
}); });
break; break;
case 2: case 2:
final isComfirmed = await showDialog<bool>( final isComfirmed = await showPopUp<bool>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertWithTwoActions( return AlertWithTwoActions(

View file

@ -1,3 +1,4 @@
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/screens/new_wallet/widgets/select_button.dart'; import 'package:cake_wallet/src/screens/new_wallet/widgets/select_button.dart';
@ -35,7 +36,7 @@ class SeedLanguageSelectorState extends State<SeedLanguageSelector> {
image: null, image: null,
text: seedLocales[seedLanguages.indexOf(selected)], text: seedLocales[seedLanguages.indexOf(selected)],
onTap: () async { onTap: () async {
final selected = await showDialog<String>( final selected = await showPopUp<String>(
context: context, context: context,
builder: (BuildContext context) => builder: (BuildContext context) =>
SeedLanguagePicker(key: _pickerKey, selected: this.selected)); SeedLanguagePicker(key: _pickerKey, selected: this.selected));

View file

@ -0,0 +1,22 @@
import 'package:flutter/material.dart';
Future<T> showPopUp<T>({
@required BuildContext context,
WidgetBuilder builder,
bool barrierDismissible = true,
Color barrierColor,
bool useSafeArea = false,
bool useRootNavigator = true,
RouteSettings routeSettings,
Widget child,
}) {
return showDialog<T>(
context: context,
builder: builder,
barrierDismissible: barrierDismissible,
barrierColor: barrierColor,
useSafeArea: useSafeArea,
useRootNavigator: useRootNavigator,
routeSettings: routeSettings,
child: child);
}

View file

@ -35,7 +35,7 @@ abstract class WalletListViewModelBase with Store {
@action @action
Future<void> remove(WalletListItem wallet) async { Future<void> remove(WalletListItem wallet) async {
final walletService = getIt.get<WalletService>(); final walletService = getIt.get<WalletService>(param1: wallet.type);
await walletService.remove(wallet.name); await walletService.remove(wallet.name);
await _walletInfoSource.delete(wallet.key); await _walletInfoSource.delete(wallet.key);
_updateList(); _updateList();