SourceOrder.fromJson constructor

SourceOrder.fromJson(
  1. Object? json
)

Implementation

factory SourceOrder.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return SourceOrder(
    amount: (map['amount'] as num).toInt(),
    currency: (map['currency'] as String),
    email: map['email'] == null ? null : (map['email'] as String),
    items: map['items'] == null
        ? null
        : (map['items'] as List<Object?>)
            .map((el) => SourceOrderItem.fromJson(el))
            .toList(),
    shipping:
        map['shipping'] == null ? null : Shipping.fromJson(map['shipping']),
  );
}