AllDayParking.fromJson constructor

AllDayParking.fromJson(
  1. Map<String, dynamic> json
)

Creates an AllDayParking object from a JSON object.

Implementation

factory AllDayParking.fromJson(Map<String, dynamic> json) {
  return AllDayParking(
    totalSpaces: ((json[ApiFields.totalCount] ?? -1) as num).toInt(),
    riderCost: ((json[ApiFields.riderCost] ?? -1.0) as num).toDouble(),
    nonRiderCost: ((json[ApiFields.nonRiderCost] ?? -1.0) as num).toDouble(),
    saturdayRiderCost:
        ((json[ApiFields.saturdayRiderCost] ?? -1.0) as num).toDouble(),
    saturdayNonRiderCost:
        ((json[ApiFields.saturdayNonRiderCost] ?? -1.0) as num).toDouble(),
  );
}