CAKE-359 | fixed yat_record.dart for multiple addresses in yat; fixed ParsedAddress class; applied ParsedAddress in the parse_address_from_domain_alert.dart; added parsedAddress and renamed applyOpenaliasOrUnstoppableDomains() to fetchParsedAddress() in the output.dart; fixed send_page.dart, send_card.dart and exchange_page.dart; added choose_yat_address_alert.dart to the app; added current wallet address to request parameters in the yat_alert.dart

This commit is contained in:
OleksandrSobol
2021-09-20 17:56:27 +03:00
parent 7fd4772121
commit 8955a10ca8
13 changed files with 253 additions and 66 deletions
+11 -6
View File
@@ -4,6 +4,7 @@ import 'package:cake_wallet/entities/calculate_fiat_amount_raw.dart';
import 'package:cake_wallet/entities/parse_address_from_domain.dart';
import 'package:cake_wallet/entities/parsed_address.dart';
import 'package:cake_wallet/monero/monero_amount_format.dart';
import 'package:cake_wallet/src/screens/send/widgets/parse_address_from_domain_alert.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:mobx/mobx.dart';
@@ -46,6 +47,8 @@ abstract class OutputBase with Store {
@observable
bool sendAll;
ParsedAddress parsedAddress;
@computed
int get formattedCryptoAmount {
int amount = 0;
@@ -127,6 +130,11 @@ abstract class OutputBase with Store {
fiatAmount = '';
address = '';
note = '';
resetParsedAddress();
}
void resetParsedAddress() {
parsedAddress = ParsedAddress(addresses: []);
}
@action
@@ -194,13 +202,10 @@ abstract class OutputBase with Store {
_cryptoNumberFormat.maximumFractionDigits = maximumFractionDigits;
}
Future<ParsedAddress> applyOpenaliasOrUnstoppableDomains() async {
Future<void> fetchParsedAddress(BuildContext context) async {
final domain = address;
final ticker = _wallet.currency.title.toLowerCase();
final parsedAddress = await parseAddressFromDomain(domain, ticker);
address = parsedAddress.address;
return parsedAddress;
parsedAddress = await parseAddressFromDomain(domain, ticker);
address = await defineAddress(context, parsedAddress);
}
}
@@ -162,7 +162,7 @@ abstract class SettingsViewModelBase with Store {
await showPopUp<void>(
context: context,
builder: (BuildContext context) {
return YatAlert(isYatDevMode: true);
return YatAlert(wallet: wallet, isYatDevMode: true);
});
},
),