mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-16 17:27:37 +00:00
sort providers by KYC
This commit is contained in:
parent
e8d0ecdc47
commit
1c29d5adc0
2 changed files with 9 additions and 8 deletions
|
@ -121,8 +121,8 @@ class TrocadorExchangeProvider extends ExchangeProvider {
|
|||
var quotes = responseJSON['quotes']['quotes'] as List;
|
||||
_provider = quotes
|
||||
.where((quote) =>
|
||||
providerStates.containsKey(quote['provider']) &&
|
||||
providerStates[quote['provider']] == true)
|
||||
providerStates.containsKey(quote['provider']) &&
|
||||
providerStates[quote['provider']] == true)
|
||||
.map((quote) => quote['provider'])
|
||||
.toList();
|
||||
|
||||
|
@ -268,11 +268,12 @@ class TrocadorExchangeProvider extends ExchangeProvider {
|
|||
final responseJSON = json.decode(response.body) as Map<String, dynamic>;
|
||||
|
||||
final providersJsonList = responseJSON['list'] as List<dynamic>;
|
||||
|
||||
return providersJsonList
|
||||
final filteredProvidersList = providersJsonList
|
||||
.map((providerJson) => TrocadorPartners.fromJson(providerJson as Map<String, dynamic>))
|
||||
.where((provider) => provider.rating != 'D')
|
||||
.toList();
|
||||
filteredProvidersList.sort((a, b) => a.rating.compareTo(b.rating));
|
||||
return filteredProvidersList;
|
||||
}
|
||||
|
||||
String _networkFor(CryptoCurrency currency) {
|
||||
|
@ -333,7 +334,7 @@ class TrocadorExchangeProvider extends ExchangeProvider {
|
|||
|
||||
class TrocadorPartners {
|
||||
final String name;
|
||||
final String? rating;
|
||||
final String rating;
|
||||
final double? insurance;
|
||||
final bool? enabledMarkup;
|
||||
final double? eta;
|
||||
|
@ -349,7 +350,7 @@ class TrocadorPartners {
|
|||
factory TrocadorPartners.fromJson(Map<String, dynamic> json) {
|
||||
return TrocadorPartners(
|
||||
name: json['name'] as String? ?? '',
|
||||
rating: json['rating'] as String?,
|
||||
rating: json['rating'] as String? ?? 'N/A',
|
||||
insurance: json['insurance'] as double?,
|
||||
enabledMarkup: json['enabledmarkup'] as bool?,
|
||||
eta: json['eta'] as double?,
|
||||
|
|
|
@ -30,7 +30,7 @@ abstract class TrocadorProvidersViewModelBase with Store {
|
|||
|
||||
providerRatings = {
|
||||
for (var provider in providers)
|
||||
provider.name: provider.rating ?? 'N/A'
|
||||
provider.name: provider.rating
|
||||
};
|
||||
|
||||
return _settingsStore
|
||||
|
|
Loading…
Reference in a new issue