cake_wallet/lib/utils/payment_request.dart
2022-08-09 17:06:21 +02:00

21 lines
No EOL
500 B
Dart

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