// To parse this JSON data, do // // final affiliations = affiliationsFromJson(jsonString); import 'dart:convert'; List affiliationsFromJson(String str) => List.from( json.decode(str).map((x) => Affiliations.fromJson(x))); String affiliationsToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); class Affiliations { int id; int userId; String orgName; String dept; String role; String timeFrame; String orgType; String emgType; dynamic createdAt; dynamic updatedAt; Affiliations({ required this.id, required this.userId, required this.orgName, required this.dept, required this.role, required this.timeFrame, required this.orgType, required this.emgType, required this.createdAt, required this.updatedAt, }); factory Affiliations.fromJson(Map json) => Affiliations( id: json["id"], userId: json["user_id"], orgName: json["org_name"], dept: json["dept"], role: json["role"], timeFrame: json["time_frame"], orgType: json["org_type"], emgType: json["emg_type"], createdAt: json["created_at"], updatedAt: json["updated_at"], ); Map toJson() => { "id": id, "user_id": userId, "org_name": orgName, "dept": dept, "role": role, "time_frame": timeFrame, "org_type": orgType, "emg_type": emgType, "created_at": createdAt, "updated_at": updatedAt, }; }