mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 12:09:43 +00:00
Fixes pre release.
This commit is contained in:
parent
dcbaf01118
commit
34aa7fdc76
25 changed files with 124 additions and 81 deletions
|
@ -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() {
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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)
|
||||||
);
|
);
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -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';
|
||||||
|
@ -40,15 +41,13 @@ class ReceivePage extends BasePage {
|
||||||
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,
|
||||||
|
@ -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,13 +116,18 @@ 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).textTheme.display3.decorationColor
|
? Theme.of(context)
|
||||||
: Theme.of(context).textTheme.display2.decorationColor;
|
.textTheme
|
||||||
|
.display3
|
||||||
|
.decorationColor
|
||||||
|
: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.display2
|
||||||
|
.decorationColor;
|
||||||
final textColor = isCurrent
|
final textColor = isCurrent
|
||||||
? Theme.of(context).textTheme.display3.color
|
? Theme.of(context).textTheme.display3.color
|
||||||
: Theme.of(context).textTheme.display2.color;
|
: Theme.of(context).textTheme.display2.color;
|
||||||
|
@ -136,8 +140,7 @@ class ReceivePage extends BasePage {
|
||||||
onEdit: () => Navigator.of(context).pushNamed(
|
onEdit: () => Navigator.of(context).pushNamed(
|
||||||
Routes.newSubaddress,
|
Routes.newSubaddress,
|
||||||
arguments: item));
|
arguments: item));
|
||||||
}
|
});
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return index != 0
|
return index != 0
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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));
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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));
|
||||||
|
|
22
lib/utils/show_pop_up.dart
Normal file
22
lib/utils/show_pop_up.dart
Normal 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);
|
||||||
|
}
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue