ShippingRateFixedAmount.fromJson constructor
ShippingRateFixedAmount.fromJson(
- Object? json
Implementation
factory ShippingRateFixedAmount.fromJson(Object? json) {
final map = (json as Map).cast<String, Object?>();
return ShippingRateFixedAmount(
amount: (map['amount'] as num).toInt(),
currency: (map['currency'] as String),
currencyOptions: map['currency_options'] == null
? null
: (map['currency_options'] as Map).cast<String, Object?>().map((
key,
value,
) =>
MapEntry(
key,
ShippingRateCurrencyOption.fromJson(value),
)),
);
}