cake_wallet/lib/utils/payment_request.dart
clear 5890df86db
cw-60: fill amount on scan qr on exchange page (#309)
* cw-60: fill amount on scan qr on exchange page
2022-03-31 18:54:45 +01:00

18 lines
No EOL
398 B
Dart

class PaymentRequest {
PaymentRequest(this.address, this.amount);
factory PaymentRequest.fromUri(Uri uri) {
var address = "";
var amount = "";
if (uri != null) {
address = uri.path;
amount = uri.queryParameters['tx_amount'] ?? uri.queryParameters['amount'] ?? "";
}
return PaymentRequest(address, amount);
}
final String address;
final String amount;
}