// To parse this JSON data, do // // final medicalInsight = medicalInsightFromJson(jsonString); import 'dart:convert'; List medicalInsightFromJson(String str) => List.from( json.decode(str).map((x) => MedicalInsight.fromJson(x))); String medicalInsightToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); class MedicalInsight { int id; String programtopic; String speakername; String role; String evaluatorname; String programdate; DateTime createdAt; DateTime updatedAt; MedicalInsight({ required this.id, required this.programtopic, required this.speakername, required this.role, required this.evaluatorname, required this.programdate, required this.createdAt, required this.updatedAt, }); factory MedicalInsight.fromJson(Map json) => MedicalInsight( id: json["id"], programtopic: json["programtopic"], speakername: json["speakername"], role: json["role"], evaluatorname: json["evaluatorname"], programdate: json["programdate"], createdAt: DateTime.parse(json["created_at"]), updatedAt: DateTime.parse(json["updated_at"]), ); Map toJson() => { "id": id, "programtopic": programtopic, "speakername": speakername, "role": role, "evaluatorname": evaluatorname, "programdate": programdate, "created_at": createdAt.toIso8601String(), "updated_at": updatedAt.toIso8601String(), }; }