PlanModel.fromMap constructor

PlanModel.fromMap(
  1. Map<String, dynamic> map
)

Implementation

factory PlanModel.fromMap(Map<String, dynamic> map) {
  return PlanModel(
    id: map['id'],
    name: map['name'],
    identifier: map['identifier'],
    interval: map['interval'],
    intervalType: map['interval_type'],
    createdAt: map['created_at'],
    updatedAt: map['updated_at'],
    prices: List<PlanPrice>.from(map['prices']?.map((x) => PlanPrice.fromMap(x))),
    features: List<PlanFeature>.from(map['features']?.map((x) => PlanFeature.fromMap(x))),
  );
}