mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-24 04:29:28 +00:00
f078457c7b
Add deep linking to iOS
25 lines
No EOL
650 B
Dart
25 lines
No EOL
650 B
Dart
class PaymentRequest {
|
|
PaymentRequest(this.address, this.amount, this.note, this.scheme);
|
|
|
|
factory PaymentRequest.fromUri(Uri? uri) {
|
|
var address = "";
|
|
var amount = "";
|
|
var note = "";
|
|
var scheme = "";
|
|
|
|
if (uri != null) {
|
|
address = uri.path;
|
|
amount = uri.queryParameters['tx_amount'] ?? uri.queryParameters['amount'] ?? "";
|
|
note = uri.queryParameters['tx_description']
|
|
?? uri.queryParameters['message'] ?? "";
|
|
scheme = uri.scheme;
|
|
}
|
|
|
|
return PaymentRequest(address, amount, note, scheme);
|
|
}
|
|
|
|
final String address;
|
|
final String amount;
|
|
final String note;
|
|
final String scheme;
|
|
} |