BonusModel.fromMap constructor

BonusModel.fromMap(
  1. Map<String, dynamic> json
)

Implementation

factory BonusModel.fromMap(Map<String, dynamic> json) => BonusModel(
      id: json["id"],
      amount: json["amount"],
      orderCount: json["order_count"],
      activeFrom: json["active_from"] == null
          ? null
          : DateTime.parse(json["active_from"]).toLocal(),
      activeTill: json["active_till"] == null
          ? null
          : DateTime.parse(json["active_till"]).toLocal(),
      createdAt: json["created_at"] == null
          ? null
          : DateTime.parse(json["created_at"]).toLocal(),
    );