Fix nullability issue in create trade response

This commit is contained in:
OmarHatem 2022-12-01 18:09:21 +02:00
parent c547295a02
commit 47764835c3

View file

@ -114,7 +114,7 @@ class ChangeNowExchangeProvider extends ExchangeProvider {
final uri = Uri.https(apiAuthority, createTradePath);
final response = await post(uri, headers: headers, body: json.encode(body));
if (response.statusCode == 400) {
final responseJSON = json.decode(response.body) as Map<String, dynamic>;
final error = responseJSON['error'] as String;
@ -128,9 +128,9 @@ class ChangeNowExchangeProvider extends ExchangeProvider {
final responseJSON = json.decode(response.body) as Map<String, dynamic>;
final id = responseJSON['id'] as String;
final inputAddress = responseJSON['payinAddress'] as String;
final refundAddress = responseJSON['refundAddress'] as String;
final extraId = responseJSON['payinExtraId'] as String;
final inputAddress = responseJSON['payinAddress'] as String?;
final refundAddress = responseJSON['refundAddress'] as String?;
final extraId = responseJSON['payinExtraId'] as String?;
return Trade(
id: id,