cake_wallet/lib/utils/payment_request.dart
2022-08-11 15:40:38 +01:00

22 lines
No EOL
557 B
Dart

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