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
Future<void> rescan({int height}) async {
// FIXME: Unimplemented
monero_wallet.rescanBlockchainAsync();
}
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/cupertino.dart';
import 'package:flutter/services.dart';
@ -246,7 +247,7 @@ class ContactListPage extends BasePage {
}
Future<bool> showAlertDialog(BuildContext context) async {
return await showDialog(
return await showPopUp(
context: context,
builder: (BuildContext context) {
return AlertWithTwoActions(
@ -261,7 +262,7 @@ class ContactListPage extends BasePage {
Future<bool> showNameAndAddressDialog(
BuildContext context, String name, String address) async {
return await showDialog(
return await showPopUp(
context: context,
builder: (BuildContext context) {
return AlertWithTwoActions(

View file

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

View file

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

View file

@ -1,4 +1,5 @@
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:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
@ -31,7 +32,7 @@ class HeaderRow extends StatelessWidget {
),
GestureDetector(
onTap: () {
showDialog<void>(
showPopUp<void>(
context: context,
builder: (context) => FilterWidget(dashboardViewModel: dashboardViewModel)
);

View file

@ -1,5 +1,6 @@
import 'dart:ui';
import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart';
@ -51,7 +52,7 @@ class DisclaimerBodyState extends State<DisclaimerPageBody> {
}
Future<void> _showAlertDialog(BuildContext context) async {
await showDialog<void>(
await showPopUp<void>(
context: context,
builder: (BuildContext context) {
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/template_tile.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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -293,7 +294,7 @@ class ExchangePage extends BasePage {
exchangeViewModel, template);
},
onRemove: () {
showDialog<void>(
showPopUp<void>(
context: context,
builder: (dialogContext) {
return AlertWithTwoActions(
@ -492,7 +493,7 @@ class ExchangePage extends BasePage {
// reaction((_) => exchangeViewModel.tradeState, (ExchangeTradeState state) {
// if (state is TradeIsCreatedFailure) {
// WidgetsBinding.instance.addPostFrameCallback((_) {
// showDialog<void>(
// showPopUp<void>(
// context: context,
// builder: (BuildContext context) {
// 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/material.dart';
import 'package:cake_wallet/generated/i18n.dart';
@ -303,7 +304,7 @@ class ExchangeCardState extends State<ExchangeCard> {
}
void _presentPicker(BuildContext context) {
showDialog<void>(
showPopUp<void>(
builder: (_) => CurrencyPicker(
selectedAtIndex: widget.currencies.indexOf(_selectedCurrency),
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:cake_wallet/exchange/exchange_provider_description.dart';
import 'package:cake_wallet/exchange/exchange_provider.dart';
@ -72,7 +73,7 @@ class PresentProviderPicker extends StatelessWidget {
}
}
showDialog<void>(
showPopUp<void>(
builder: (_) => Picker(
items: items,
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/information_page.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:mobx/mobx.dart';
import 'package:provider/provider.dart';
@ -37,7 +38,7 @@ void showInformation(ExchangeTradeViewModel exchangeTradeViewModel, BuildContext
: S.current.exchange_result_description(
trade.amount ?? fetchingLabel, trade.from.toString());
showDialog<void>(
showPopUp<void>(
context: context,
builder: (_) => InformationPage(information: information)
);
@ -255,7 +256,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
reaction((_) => sendStore.state, (SendingState state) {
if (state is SendingFailed) {
WidgetsBinding.instance.addPostFrameCallback((_) {
showDialog<void>(
showPopUp<void>(
context: context,
builder: (BuildContext context) {
return AlertWithOneAction(
@ -270,7 +271,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
if (state is TransactionCreatedSuccessfully) {
WidgetsBinding.instance.addPostFrameCallback((_) {
showDialog<void>(
showPopUp<void>(
context: context,
builder: (BuildContext context) {
return AlertWithTwoActions(
@ -292,7 +293,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
if (state is TransactionCommitted) {
WidgetsBinding.instance.addPostFrameCallback((_) {
showDialog<void>(
showPopUp<void>(
context: context,
builder: (BuildContext context) {
return AlertWithOneAction(

View file

@ -1,6 +1,7 @@
import 'package:cake_wallet/di.dart';
import 'package:cake_wallet/routes.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:flutter_mobx/flutter_mobx.dart';
import 'package:flutter/material.dart';
@ -60,7 +61,7 @@ class _WalletNameFormState extends State<WalletNameForm> {
if (state is FailureState) {
WidgetsBinding.instance.addPostFrameCallback((_) {
showDialog<void>(
showPopUp<void>(
context: context,
builder: (_) {
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/cupertino.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
@ -29,7 +30,7 @@ class NodeListPage extends BasePage {
minWidth: double.minPositive,
child: FlatButton(
onPressed: () async {
await showDialog<void>(
await showPopUp<void>(
context: context,
builder: (BuildContext context) {
return AlertWithTwoActions(
@ -83,7 +84,7 @@ class NodeListPage extends BasePage {
return;
}
await showDialog<void>(
await showPopUp<void>(
context: context,
builder: (BuildContext context) {
return AlertDialog(
@ -110,7 +111,7 @@ class NodeListPage extends BasePage {
final dismissibleRow = Dismissible(
key: Key('${node.keyIndex}'),
confirmDismiss: (direction) async {
return await showDialog(
return await showPopUp(
context: context,
builder: (BuildContext context) {
return AlertWithTwoActions(

View file

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

View file

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

View file

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

View file

@ -2,6 +2,7 @@ import 'package:cake_wallet/di.dart';
import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/src/widgets/alert_with_two_actions.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/material.dart';
import 'package:flutter/services.dart';
@ -27,12 +28,12 @@ class WalletSeedPage extends BasePage {
@override
void onClose(BuildContext context) async {
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
return AlertWithTwoActions(
alertTitle: 'Attention',
alertContent: 'Have you written it down? The seed is the only way to recover your wallet.',
leftButtonText: 'Not yet',
alertContent: 'The seed is the only way to recover your wallet. Have you written it down?',
leftButtonText: 'Go back',
rightButtonText: 'Yes, I have',
actionLeftButton: () => Navigator.of(context).pop(false),
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/scollable_with_bottom_section.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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -397,7 +398,7 @@ class SendPage extends BasePage {
// getOpenaliasRecord(context);
// },
// onRemove: () {
// showDialog<void>(
// showPopUp<void>(
// context: context,
// builder: (dialogContext) {
// return AlertWithTwoActions(
@ -492,7 +493,7 @@ class SendPage extends BasePage {
reaction((_) => sendViewModel.state, (ExecutionState state) {
if (state is FailureState) {
WidgetsBinding.instance.addPostFrameCallback((_) {
showDialog<void>(
showPopUp<void>(
context: context,
builder: (BuildContext context) {
return AlertWithOneAction(
@ -506,7 +507,7 @@ class SendPage extends BasePage {
if (state is ExecutedSuccessfullyState) {
WidgetsBinding.instance.addPostFrameCallback((_) {
showDialog<void>(
showPopUp<void>(
context: context,
builder: (BuildContext context) {
return ConfirmSendingAlert(
@ -521,7 +522,7 @@ class SendPage extends BasePage {
actionLeftButton: () {
Navigator.of(context).pop();
sendViewModel.commitTransaction();
showDialog<void>(
showPopUp<void>(
context: context,
builder: (BuildContext context) {
return Observer(builder: (_) {
@ -635,7 +636,7 @@ class SendPage extends BasePage {
// if (isOpenalias) {
// _addressController.text = sendViewModel.recordAddress;
// await showDialog<void>(
// await showPopUp<void>(
// context: context,
// builder: (BuildContext context) {
// return AlertWithOneAction(
@ -653,7 +654,7 @@ class SendPage extends BasePage {
// final items = TransactionPriority.all;
// final selectedItem = items.indexOf(sendViewModel.transactionPriority);
//
// await showDialog<void>(
// await showPopUp<void>(
// builder: (_) => Picker(
// items: items,
// selectedAtIndex: selectedItem,

View file

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

View file

@ -1,3 +1,4 @@
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/src/widgets/picker.dart';
import 'package:cake_wallet/src/widgets/standard_list.dart';
@ -16,7 +17,7 @@ class SettingsPickerCell<ItemType> extends StandardListRow {
onTap: (BuildContext context) async {
final selectedAtIndex = items.indexOf(selectedItem);
await showDialog<void>(
await showPopUp<void>(
context: context,
builder: (_) => Picker(
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/cupertino.dart';
import 'package:cake_wallet/generated/i18n.dart';
@ -26,7 +27,7 @@ class SetupPinCodePage extends BasePage {
}
if (!pinCodeViewModel.isPinCodeCorrect) {
await showDialog<void>(
await showPopUp<void>(
context: context,
builder: (BuildContext context) {
return AlertWithOneAction(
@ -43,7 +44,7 @@ class SetupPinCodePage extends BasePage {
try {
await pinCodeViewModel.setupPinCode();
await showDialog<void>(
await showPopUp<void>(
context: context,
builder: (BuildContext context) {
return AlertWithOneAction(
@ -60,7 +61,7 @@ class SetupPinCodePage extends BasePage {
});
} catch (e) {
// FIXME: Add translation for alert content text.
await showDialog<void>(
await showPopUp<void>(
context: context,
builder: (BuildContext context) {
return AlertWithOneAction(

View file

@ -1,4 +1,5 @@
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:flutter/material.dart';
import 'package:cake_wallet/routes.dart';
@ -126,7 +127,7 @@ class WalletMenu {
});
break;
case 2:
final isComfirmed = await showDialog<bool>(
final isComfirmed = await showPopUp<bool>(
context: context,
builder: (BuildContext context) {
return AlertWithTwoActions(

View file

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