mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 03:59:23 +00:00
Fix exchange limits issue (#545)
* Allow nullable values from limits API * Handle null values in SideShift limits API response
This commit is contained in:
parent
c7ea9d52ee
commit
a2dfbc6076
2 changed files with 4 additions and 4 deletions
|
@ -85,8 +85,8 @@ class ChangeNowExchangeProvider extends ExchangeProvider {
|
|||
|
||||
final responseJSON = json.decode(response.body) as Map<String, dynamic>;
|
||||
return Limits(
|
||||
min: responseJSON['minAmount'] as double,
|
||||
max: responseJSON['maxAmount'] as double);
|
||||
min: responseJSON['minAmount'] as double?,
|
||||
max: responseJSON['maxAmount'] as double?);
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -192,8 +192,8 @@ class SideShiftExchangeProvider extends ExchangeProvider {
|
|||
}
|
||||
|
||||
final responseJSON = json.decode(response.body) as Map<String, dynamic>;
|
||||
final min = double.parse(responseJSON['min'] as String);
|
||||
final max = double.parse(responseJSON['max'] as String);
|
||||
final min = double.tryParse(responseJSON['min'] as String? ?? '');
|
||||
final max = double.tryParse(responseJSON['max'] as String? ?? '');
|
||||
|
||||
return Limits(min: min, max: max);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue