105 lines
2.3 KiB
Dart
105 lines
2.3 KiB
Dart
import 'package:hive_flutter/hive_flutter.dart';
|
|
part 'sessionnotesmodel.g.dart';
|
|
|
|
class NotesResp {
|
|
NotesData? data;
|
|
|
|
NotesResp({this.data});
|
|
|
|
NotesResp.fromJson(Map<String, dynamic> json) {
|
|
if (json["data"] is Map) {
|
|
data = json["data"] == null ? null : NotesData.fromJson(json["data"]);
|
|
}
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> _data = <String, dynamic>{};
|
|
if (data != null) {
|
|
_data["data"] = data?.toJson();
|
|
}
|
|
return _data;
|
|
}
|
|
}
|
|
|
|
class NotesData {
|
|
List<SessionNotesModel>? events;
|
|
|
|
NotesData({this.events});
|
|
|
|
NotesData.fromJson(Map<String, dynamic> json) {
|
|
if (json["notes"] is List) {
|
|
events = json["notes"] == null
|
|
? null
|
|
: (json["notes"] as List)
|
|
.map((e) => SessionNotesModel.fromJson(e))
|
|
.toList();
|
|
}
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> _data = <String, dynamic>{};
|
|
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<String, dynamic> 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<String, dynamic> toJson() {
|
|
final Map<String, dynamic> _data = <String, dynamic>{};
|
|
_data["session_name"] = selectedSession;
|
|
_data["note"] = notes;
|
|
_data["speakerr_name"] = hcpname;
|
|
_data["eid"] = eventid;
|
|
_data["name"] = eventname;
|
|
|
|
return _data;
|
|
}
|
|
}
|