import 'package:hive_flutter/hive_flutter.dart'; part 'sessionnotesmodel.g.dart'; class NotesResp { NotesData? data; NotesResp({this.data}); NotesResp.fromJson(Map json) { if (json["data"] is Map) { data = json["data"] == null ? null : NotesData.fromJson(json["data"]); } } Map toJson() { final Map _data = {}; if (data != null) { _data["data"] = data?.toJson(); } return _data; } } class NotesData { List? events; NotesData({this.events}); NotesData.fromJson(Map json) { if (json["notes"] is List) { events = json["notes"] == null ? null : (json["notes"] as List) .map((e) => SessionNotesModel.fromJson(e)) .toList(); } } Map toJson() { final Map _data = {}; if (events != null) { _data["notes"] = events?.map((e) => e.toJson()).toList(); } return _data; } } @HiveType(typeId: 4) class SessionNotesModel { @HiveField(0) String? selectedSession; @HiveField(1) String? notes; @HiveField(2) String? hcpid; @HiveField(3) String? eventid; @HiveField(4) String? addedBy; @HiveField(5) String? addedDate; @HiveField(6) String? eventname; @HiveField(7) String? hcpname; SessionNotesModel( {this.selectedSession, this.addedBy, this.addedDate, this.eventid, this.hcpid, this.hcpname, this.eventname, this.notes}); SessionNotesModel.fromJson(Map json) { if (json["session_name"] is String) { selectedSession = json["session_name"] ?? null; } if (json["note"] is String) { notes = json["note"] ?? null; } if (json["speakerr_name"] is String) { hcpname = json["speakerr_name"] ?? null; } if (json["eid"] is String) { eventid = json["eid"]; } if (json["name"] is String) { eventname = json["name"]; } } Map toJson() { final Map _data = {}; _data["session_name"] = selectedSession; _data["note"] = notes; _data["speakerr_name"] = hcpname; _data["eid"] = eventid; _data["name"] = eventname; return _data; } }