57 lines
1.6 KiB
Dart
57 lines
1.6 KiB
Dart
|
// To parse this JSON data, do
|
||
|
//
|
||
|
// final medicalInsight = medicalInsightFromJson(jsonString);
|
||
|
|
||
|
import 'dart:convert';
|
||
|
|
||
|
List<MedicalInsight> medicalInsightFromJson(String str) =>
|
||
|
List<MedicalInsight>.from(
|
||
|
json.decode(str).map((x) => MedicalInsight.fromJson(x)));
|
||
|
|
||
|
String medicalInsightToJson(List<MedicalInsight> data) =>
|
||
|
json.encode(List<dynamic>.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<String, dynamic> 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<String, dynamic> toJson() => {
|
||
|
"id": id,
|
||
|
"programtopic": programtopic,
|
||
|
"speakername": speakername,
|
||
|
"role": role,
|
||
|
"evaluatorname": evaluatorname,
|
||
|
"programdate": programdate,
|
||
|
"created_at": createdAt.toIso8601String(),
|
||
|
"updated_at": updatedAt.toIso8601String(),
|
||
|
};
|
||
|
}
|