PlanTiersItem.fromJson constructor

PlanTiersItem.fromJson(
  1. Object? json
)

Implementation

factory PlanTiersItem.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return PlanTiersItem(
    flatAmount: map['flat_amount'] == null
        ? null
        : (map['flat_amount'] as num).toInt(),
    flatAmountDecimal: map['flat_amount_decimal'] == null
        ? null
        : (map['flat_amount_decimal'] as String),
    unitAmount: map['unit_amount'] == null
        ? null
        : (map['unit_amount'] as num).toInt(),
    unitAmountDecimal: map['unit_amount_decimal'] == null
        ? null
        : (map['unit_amount_decimal'] as String),
    upTo: PlanUpTo.fromJson(map['up_to']),
  );
}