mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
cake pay country picker (#1779)
* cake pay country picker
* UI changes
* hide picker after the country is set
* Revert "hide picker after the country is set"
This reverts commit cce358b94f
.
* show country picker initially
* flags
* minor ui fixes
* Update lib/view_model/cake_pay/cake_pay_cards_list_view_model.dart
---------
Co-authored-by: tuxpizza <tuxsudo@tux.pizza>
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
parent
c8cfc2cff1
commit
48457fdd6d
132 changed files with 601 additions and 78 deletions
|
@ -3,6 +3,7 @@ import 'dart:convert';
|
|||
import 'package:cake_wallet/cake_pay/cake_pay_order.dart';
|
||||
import 'package:cake_wallet/cake_pay/cake_pay_user_credentials.dart';
|
||||
import 'package:cake_wallet/cake_pay/cake_pay_vendor.dart';
|
||||
import 'package:cake_wallet/entities/country.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
class CakePayApi {
|
||||
|
@ -171,7 +172,7 @@ class CakePayApi {
|
|||
}
|
||||
|
||||
/// Get Countries
|
||||
Future<List<String>> getCountries(
|
||||
Future<List<Country>> getCountries(
|
||||
{required String CSRFToken, required String authorization}) async {
|
||||
final uri = Uri.https(baseCakePayUri, countriesPath);
|
||||
|
||||
|
@ -188,8 +189,11 @@ class CakePayApi {
|
|||
}
|
||||
|
||||
final bodyJson = json.decode(response.body) as List;
|
||||
|
||||
return bodyJson.map<String>((country) => country['name'] as String).toList();
|
||||
return bodyJson
|
||||
.map<String>((country) => country['name'] as String)
|
||||
.map((name) => Country.fromCakePayName(name))
|
||||
.whereType<Country>()
|
||||
.toList();
|
||||
}
|
||||
|
||||
/// Get Vendors
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue