2022-03-31 17:54:45 +00:00
|
|
|
class PaymentRequest {
|
2022-08-11 14:40:38 +00:00
|
|
|
PaymentRequest(this.address, this.amount, this.note);
|
2022-03-31 17:54:45 +00:00
|
|
|
|
|
|
|
factory PaymentRequest.fromUri(Uri uri) {
|
|
|
|
var address = "";
|
|
|
|
var amount = "";
|
2022-08-11 14:40:38 +00:00
|
|
|
var note = "";
|
2022-03-31 17:54:45 +00:00
|
|
|
|
|
|
|
if (uri != null) {
|
|
|
|
address = uri.path;
|
|
|
|
amount = uri.queryParameters['tx_amount'] ?? uri.queryParameters['amount'] ?? "";
|
2022-08-11 14:40:38 +00:00
|
|
|
note = uri.queryParameters['tx_description']
|
|
|
|
?? uri.queryParameters['message'] ?? "";
|
2022-03-31 17:54:45 +00:00
|
|
|
}
|
|
|
|
|
2022-08-11 14:40:38 +00:00
|
|
|
return PaymentRequest(address, amount, note);
|
2022-03-31 17:54:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
final String address;
|
|
|
|
final String amount;
|
2022-08-11 14:40:38 +00:00
|
|
|
final String note;
|
2022-03-31 17:54:45 +00:00
|
|
|
}
|