mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 20:39:51 +00:00
cw-60: fill amount on scan qr on exchange page (#309)
* cw-60: fill amount on scan qr on exchange page
This commit is contained in:
parent
1cd90cf57d
commit
5890df86db
20 changed files with 92 additions and 42 deletions
18
lib/utils/payment_request.dart
Normal file
18
lib/utils/payment_request.dart
Normal file
|
@ -0,0 +1,18 @@
|
|||
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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue