CAKE-359 | added text field for extracted (from Yat, Unstoppable Domains, OpenAlias) address to send_card.dart; added extractedAddress and isParsedAddress parameters to output.dart; applied extractedAddress to monero_wallet.dart and electrum_wallet.dart; added TextValidator to send_view_model.dart

This commit is contained in:
OleksandrSobol
2021-09-22 16:47:10 +03:00
parent 9958f6c2e0
commit 3b649ef682
7 changed files with 116 additions and 69 deletions
+10 -1
View File
@@ -47,8 +47,16 @@ abstract class OutputBase with Store {
@observable
bool sendAll;
@observable
ParsedAddress parsedAddress;
@observable
String extractedAddress;
@computed
bool get isParsedAddress => parsedAddress.parseFrom != ParseFrom.notParsed
&& parsedAddress.name.isNotEmpty;
@computed
int get formattedCryptoAmount {
int amount = 0;
@@ -134,6 +142,7 @@ abstract class OutputBase with Store {
}
void resetParsedAddress() {
extractedAddress = '';
parsedAddress = ParsedAddress(addresses: []);
}
@@ -206,6 +215,6 @@ abstract class OutputBase with Store {
final domain = address;
final ticker = _wallet.currency.title.toLowerCase();
parsedAddress = await parseAddressFromDomain(domain, ticker);
address = await defineAddress(context, parsedAddress);
extractedAddress = await defineAddress(context, parsedAddress);
}
}
+2
View File
@@ -117,6 +117,8 @@ abstract class SendViewModelBase with Store {
Validator get addressValidator => AddressValidator(type: _wallet.currency);
Validator get textValidator => TextValidator();
@observable
PendingTransaction pendingTransaction;