session notes added to hive

This commit is contained in:
snehalathad@aissel.com 2024-12-10 16:00:04 +05:30
parent cef857093e
commit 602230270b
4 changed files with 64 additions and 17 deletions

View File

@ -19,9 +19,9 @@ class HiveApiConstantsAdapter extends TypeAdapter<HiveApiConstants> {
return HiveApiConstants( return HiveApiConstants(
functionName: fields[0] as String?, functionName: fields[0] as String?,
interval: fields[1] as int?, interval: fields[1] as int?,
) method: fields[2] as String?,
..method = fields[2] as String? module: fields[3] as String?,
..module = fields[3] as String?; );
} }
@override @override

View File

@ -63,15 +63,34 @@ class SessionNotesModel {
String? eventname; String? eventname;
@HiveField(7) @HiveField(7)
String? hcpname; String? hcpname;
SessionNotesModel( @HiveField(8)
{this.selectedSession, String? kolid;
this.addedBy, @HiveField(9)
this.addedDate, String? event_attendees_id;
this.eventid, @HiveField(10)
this.hcpid, String? kid;
this.hcpname, @HiveField(11)
this.eventname, String? filepath;
this.notes}); @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) { SessionNotesModel.fromJson(Map<String, dynamic> json) {
if (json["session_name"] is String) { if (json["session_name"] is String) {

View File

@ -25,13 +25,19 @@ class SessionNotesModelAdapter extends TypeAdapter<SessionNotesModel> {
hcpname: fields[7] as String?, hcpname: fields[7] as String?,
eventname: fields[6] as String?, eventname: fields[6] as String?,
notes: fields[1] 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 @override
void write(BinaryWriter writer, SessionNotesModel obj) { void write(BinaryWriter writer, SessionNotesModel obj) {
writer writer
..writeByte(8) ..writeByte(14)
..writeByte(0) ..writeByte(0)
..write(obj.selectedSession) ..write(obj.selectedSession)
..writeByte(1) ..writeByte(1)
@ -47,7 +53,19 @@ class SessionNotesModelAdapter extends TypeAdapter<SessionNotesModel> {
..writeByte(6) ..writeByte(6)
..write(obj.eventname) ..write(obj.eventname)
..writeByte(7) ..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 @override

View File

@ -796,12 +796,22 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
notes: notesController.text, notes: notesController.text,
addedBy: "user", addedBy: "user",
addedDate: CustomDateFormatter().formatDate(), addedDate: CustomDateFormatter().formatDate(),
eventid: widget.eventid, eventid: sessionsTopicsData!.kolEventsId,
hcpid: widget.eventid, hcpid: widget.eventid,
kolid: sessionsTopicsData!.kolId,
event_attendees_id:
sessionsTopicsData!.eventAttendeesId,
kid: eventsdetail.kId,
filepath: attachedFileName != ''
? attachedFilePath
: "",
filename: attachedFileName != ''
? attachedFileName
: "",
selectedSession: _selectedFruit); selectedSession: _selectedFruit);
print(
"${notesModel.addedBy},${notesModel.notes},${notesModel.addedDate},${notesModel.eventid},${notesModel.hcpid},${notesModel.selectedSession}");
await provider.addSessionNotes(notesModel); await provider.addSessionNotes(notesModel);
_selectedFruit = null; _selectedFruit = null;
isLoading = false; isLoading = false;
sessionsTopicsData = null; sessionsTopicsData = null;