Fixes for backups for Android. Fixes for send almost all amount.

This commit is contained in:
M
2021-01-29 22:18:07 +02:00
parent 5631961e47
commit 2ce34919bf
10 changed files with 60 additions and 21 deletions
+9 -3
View File
@@ -14,6 +14,7 @@ import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:cake_wallet/view_model/backup_view_model.dart';
import 'package:cake_wallet/core/execution_state.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:permission_handler/permission_handler.dart';
class BackupPage extends BasePage {
BackupPage(this.backupViewModelBase);
@@ -99,8 +100,6 @@ class BackupPage extends BasePage {
actionRightButton: () async {
Navigator.of(dialogContext).pop();
final backup = await backupViewModelBase.exportBackup();
await backupViewModelBase.saveToDownload(
backup.name, backup.content);
if (Platform.isAndroid) {
onExportAndroid(context, backup);
@@ -123,9 +122,16 @@ class BackupPage extends BasePage {
rightButtonText: 'Save to Downloads',
leftButtonText: 'Share',
actionRightButton: () async {
Navigator.of(dialogContext).pop();
final permission = await Permission.storage.request();
if (permission.isDenied) {
Navigator.of(dialogContext).pop();
return;
}
await backupViewModelBase.saveToDownload(
backup.name, backup.content);
Navigator.of(dialogContext).pop();
},
actionLeftButton: () {
Navigator.of(dialogContext).pop();
@@ -255,11 +255,11 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
.pendingTransaction.feeFormatted,
rightButtonText: S.of(context).ok,
leftButtonText: S.of(context).cancel,
actionRightButton: () {
actionRightButton: () async {
Navigator.of(context).pop();
widget.exchangeTradeViewModel.sendViewModel
await widget.exchangeTradeViewModel.sendViewModel
.commitTransaction();
showPopUp<void>(
await showPopUp<void>(
context: context,
builder: (BuildContext context) {
return Observer(builder: (_) {
@@ -359,10 +359,10 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
});
},
actionLeftButton: () => Navigator.of(context).pop(),
feeFiatAmount: widget.exchangeTradeViewModel.sendViewModel
.pendingTransaction.feeFormatted,
feeFiatAmount: widget.exchangeTradeViewModel.sendViewModel.pendingTransactionFeeFiatAmount
+ ' ' + widget.exchangeTradeViewModel.sendViewModel.fiat.title,
fiatAmountValue: widget.exchangeTradeViewModel.sendViewModel
.pendingTransactionFeeFiatAmount +
.pendingTransactionFiatAmount +
' ' +
widget.exchangeTradeViewModel.sendViewModel.fiat.title,
recipientTitle: S.of(context).recipient_address,