LocationModel.fromJson constructor

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

Implementation

LocationModel.fromJson(Map<String, dynamic> json) {
  id = json['locationId'] ?? 0;
  uniqueId = json['uniqueId'] ?? '';
  locationLabel = json['locationLabel'] ?? '';
  favourite = json['favourite'] ?? 0;
  street = json['street'] ?? '';
  zip = json['zip'] ?? '';
  city = json['city'] ?? '';
  state = json['state'] ?? '';
  country = json['country'] ?? '';
  utcModifier = json['utcModifier'] ?? '';
  lat = json['lat'] ?? 0;
  lng = json['lng'] ?? 0;
  type = LocationType.values[json['type'] ?? 0];
  contactPhone = json['contactPhone'] ?? '';
  deliveryInstructions = json['deliveryInstructions'] ?? '';
  setAsDefault = json['setAsDefault'] == 1;
}