Fixed qr image on Receive screen for Litecoin (#296)

This commit is contained in:
Serhii
2022-03-23 18:13:53 +01:00
committed by GitHub
parent c10d5ef83c
commit d88ecdb2bb
@@ -60,6 +60,22 @@ class BitcoinURI extends PaymentURI {
}
}
class LitecoinURI extends PaymentURI {
LitecoinURI({String amount, String address})
: super(amount: amount, address: address);
@override
String toString() {
var base = 'litecoin:' + address;
if (amount?.isNotEmpty ?? false) {
base += '?amount=${amount.replaceAll(',', '.')}';
}
return base;
}
}
abstract class WalletAddressListViewModelBase with Store {
WalletAddressListViewModelBase({
@required AppStore appStore,
@@ -121,6 +137,10 @@ abstract class WalletAddressListViewModelBase with Store {
return BitcoinURI(amount: amount, address: address.address);
}
if (_wallet.type == WalletType.litecoin) {
return LitecoinURI(amount: amount, address: address.address);
}
return null;
}