diff --git a/lib/view_model/wallet_address_list/wallet_address_list_view_model.dart b/lib/view_model/wallet_address_list/wallet_address_list_view_model.dart index e4aeca011..d3730223f 100644 --- a/lib/view_model/wallet_address_list/wallet_address_list_view_model.dart +++ b/lib/view_model/wallet_address_list/wallet_address_list_view_model.dart @@ -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; }