// To parse this JSON data, do // // final loc = locFromJson(jsonString); import 'dart:convert'; List locFromJson(String str) => List.from(json.decode(str).map((x) => Loc.fromJson(x))); String locToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); class Loc { int id; int userId; String institution; String address; String city; String state; int postalCode; Loc({ required this.id, required this.userId, required this.institution, required this.address, required this.city, required this.state, required this.postalCode, }); factory Loc.fromJson(Map json) => Loc( id: json["id"], userId: json["user_id"], institution: json["Institution"], address: json["Address"], city: json["City"], state: json["State"], postalCode: json["Postal_code"], ); Map toJson() => { "id": id, "user_id": userId, "Institution": institution, "Address": address, "City": city, "State": state, "Postal_code": postalCode, }; }