fromJson static method

CurrencyExchangeRate? fromJson(
  1. Map<String, dynamic>? json
)

Implementation

static CurrencyExchangeRate? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return CurrencyExchangeRate(
    currency: (json['currency'] as String?) ?? '',
    rate: (json['rate'] as num?)?.toDouble() ?? 0.0,
  );
}