fromJson static method

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

Implementation

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

  return ShippingOption(
    id: (json['id'] as String?) ?? '',
    title: (json['title'] as String?) ?? '',
    priceParts: List<LabeledPricePart>.from(
        ((json['price_parts'] as List<dynamic>?) ?? <dynamic>[])
            .map((item) =>
                LabeledPricePart.fromJson(item as Map<String, dynamic>?))
            .toList()),
  );
}