TerminalReaderReaderResourceCart.fromJson constructor

TerminalReaderReaderResourceCart.fromJson(
  1. Object? json
)

Implementation

factory TerminalReaderReaderResourceCart.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return TerminalReaderReaderResourceCart(
    currency: (map['currency'] as String),
    lineItems: (map['line_items'] as List<Object?>)
        .map((el) => TerminalReaderReaderResourceLineItem.fromJson(el))
        .toList(),
    tax: map['tax'] == null ? null : (map['tax'] as num).toInt(),
    total: (map['total'] as num).toInt(),
  );
}