// To parse this JSON data, do // // final trials = trialsFromJson(jsonString); import 'dart:convert'; List trialsFromJson(String str) => List.from(json.decode(str).map((x) => Trials.fromJson(x))); String trialsToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); class Trials { int id; int userId; String ctId; String trialName; String status; String sponsors; String condition; String intervention; String phase; dynamic createdAt; dynamic updatedAt; Trials({ required this.id, required this.userId, required this.ctId, required this.trialName, required this.status, required this.sponsors, required this.condition, required this.intervention, required this.phase, required this.createdAt, required this.updatedAt, }); factory Trials.fromJson(Map json) => Trials( id: json["id"], userId: json["user_id"], ctId: json["ct_id"], trialName: json["trial_name"], status: json["status"], sponsors: json["sponsors"], condition: json["condition"], intervention: json["intervention"], phase: json["phase"], createdAt: json["created_at"], updatedAt: json["updated_at"], ); Map toJson() => { "id": id, "user_id": userId, "ct_id": ctId, "trial_name": trialName, "status": status, "sponsors": sponsors, "condition": condition, "intervention": intervention, "phase": phase, "created_at": createdAt, "updated_at": updatedAt, }; }