session notes added to hive
This commit is contained in:
parent
cef857093e
commit
602230270b
|
@ -19,9 +19,9 @@ class HiveApiConstantsAdapter extends TypeAdapter<HiveApiConstants> {
|
|||
return HiveApiConstants(
|
||||
functionName: fields[0] as String?,
|
||||
interval: fields[1] as int?,
|
||||
)
|
||||
..method = fields[2] as String?
|
||||
..module = fields[3] as String?;
|
||||
method: fields[2] as String?,
|
||||
module: fields[3] as String?,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -63,15 +63,34 @@ class SessionNotesModel {
|
|||
String? eventname;
|
||||
@HiveField(7)
|
||||
String? hcpname;
|
||||
SessionNotesModel(
|
||||
{this.selectedSession,
|
||||
this.addedBy,
|
||||
this.addedDate,
|
||||
this.eventid,
|
||||
this.hcpid,
|
||||
this.hcpname,
|
||||
this.eventname,
|
||||
this.notes});
|
||||
@HiveField(8)
|
||||
String? kolid;
|
||||
@HiveField(9)
|
||||
String? event_attendees_id;
|
||||
@HiveField(10)
|
||||
String? kid;
|
||||
@HiveField(11)
|
||||
String? filepath;
|
||||
@HiveField(12)
|
||||
String? filename;
|
||||
@HiveField(13)
|
||||
String? noteId;
|
||||
SessionNotesModel({
|
||||
this.selectedSession,
|
||||
this.addedBy,
|
||||
this.addedDate,
|
||||
this.eventid,
|
||||
this.hcpid,
|
||||
this.hcpname,
|
||||
this.eventname,
|
||||
this.notes,
|
||||
this.event_attendees_id,
|
||||
this.filename,
|
||||
this.filepath,
|
||||
this.kid,
|
||||
this.kolid,
|
||||
this.noteId,
|
||||
});
|
||||
|
||||
SessionNotesModel.fromJson(Map<String, dynamic> json) {
|
||||
if (json["session_name"] is String) {
|
||||
|
|
|
@ -25,13 +25,19 @@ class SessionNotesModelAdapter extends TypeAdapter<SessionNotesModel> {
|
|||
hcpname: fields[7] as String?,
|
||||
eventname: fields[6] as String?,
|
||||
notes: fields[1] as String?,
|
||||
event_attendees_id: fields[9] as String?,
|
||||
filename: fields[12] as String?,
|
||||
filepath: fields[11] as String?,
|
||||
kid: fields[10] as String?,
|
||||
kolid: fields[8] as String?,
|
||||
noteId: fields[13] as String?,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void write(BinaryWriter writer, SessionNotesModel obj) {
|
||||
writer
|
||||
..writeByte(8)
|
||||
..writeByte(14)
|
||||
..writeByte(0)
|
||||
..write(obj.selectedSession)
|
||||
..writeByte(1)
|
||||
|
@ -47,7 +53,19 @@ class SessionNotesModelAdapter extends TypeAdapter<SessionNotesModel> {
|
|||
..writeByte(6)
|
||||
..write(obj.eventname)
|
||||
..writeByte(7)
|
||||
..write(obj.hcpname);
|
||||
..write(obj.hcpname)
|
||||
..writeByte(8)
|
||||
..write(obj.kolid)
|
||||
..writeByte(9)
|
||||
..write(obj.event_attendees_id)
|
||||
..writeByte(10)
|
||||
..write(obj.kid)
|
||||
..writeByte(11)
|
||||
..write(obj.filepath)
|
||||
..writeByte(12)
|
||||
..write(obj.filename)
|
||||
..writeByte(13)
|
||||
..write(obj.noteId);
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -796,12 +796,22 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
|
|||
notes: notesController.text,
|
||||
addedBy: "user",
|
||||
addedDate: CustomDateFormatter().formatDate(),
|
||||
eventid: widget.eventid,
|
||||
eventid: sessionsTopicsData!.kolEventsId,
|
||||
hcpid: widget.eventid,
|
||||
kolid: sessionsTopicsData!.kolId,
|
||||
event_attendees_id:
|
||||
sessionsTopicsData!.eventAttendeesId,
|
||||
kid: eventsdetail.kId,
|
||||
filepath: attachedFileName != ''
|
||||
? attachedFilePath
|
||||
: "",
|
||||
filename: attachedFileName != ''
|
||||
? attachedFileName
|
||||
: "",
|
||||
selectedSession: _selectedFruit);
|
||||
print(
|
||||
"${notesModel.addedBy},${notesModel.notes},${notesModel.addedDate},${notesModel.eventid},${notesModel.hcpid},${notesModel.selectedSession}");
|
||||
|
||||
await provider.addSessionNotes(notesModel);
|
||||
|
||||
_selectedFruit = null;
|
||||
isLoading = false;
|
||||
sessionsTopicsData = null;
|
||||
|
|
Loading…
Reference in New Issue