add notifications api call
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/mih_objects/app_user.dart';
|
||||
import 'package:patient_manager/mih_objects/business.dart';
|
||||
import 'package:patient_manager/mih_objects/business_user.dart';
|
||||
import 'package:patient_manager/mih_objects/notification.dart';
|
||||
import 'package:patient_manager/mih_objects/patients.dart';
|
||||
|
||||
class BusinessArguments {
|
||||
@@ -22,12 +23,14 @@ class HomeArguments {
|
||||
final AppUser signedInUser;
|
||||
final BusinessUser? businessUser;
|
||||
final Business? business;
|
||||
final List<MIHNotification> notifi;
|
||||
final String profilePicUrl;
|
||||
|
||||
HomeArguments(
|
||||
this.signedInUser,
|
||||
this.businessUser,
|
||||
this.business,
|
||||
this.notifi,
|
||||
this.profilePicUrl,
|
||||
);
|
||||
}
|
||||
|
||||
43
Frontend/patient_manager/lib/mih_objects/notification.dart
Normal file
43
Frontend/patient_manager/lib/mih_objects/notification.dart
Normal file
@@ -0,0 +1,43 @@
|
||||
class MIHNotification {
|
||||
final int idnotifications;
|
||||
final String app_id;
|
||||
final String notification_message;
|
||||
final String notification_read;
|
||||
final String action_path;
|
||||
final String insert_date;
|
||||
final String notification_type;
|
||||
|
||||
const MIHNotification({
|
||||
required this.idnotifications,
|
||||
required this.app_id,
|
||||
required this.notification_message,
|
||||
required this.notification_read,
|
||||
required this.action_path,
|
||||
required this.insert_date,
|
||||
required this.notification_type,
|
||||
});
|
||||
|
||||
factory MIHNotification.fromJson(Map<String, dynamic> json) {
|
||||
return switch (json) {
|
||||
{
|
||||
"idnotifications": int idnotifications,
|
||||
"app_id": String app_id,
|
||||
"notification_message": String notification_message,
|
||||
"notification_read": String notification_read,
|
||||
"action_path": String action_path,
|
||||
"insert_date": String insert_date,
|
||||
"notification_type": String notification_type,
|
||||
} =>
|
||||
MIHNotification(
|
||||
idnotifications: idnotifications,
|
||||
app_id: app_id,
|
||||
notification_message: notification_message,
|
||||
notification_read: notification_read,
|
||||
action_path: action_path,
|
||||
insert_date: insert_date,
|
||||
notification_type: notification_type,
|
||||
),
|
||||
_ => throw const FormatException('Failed to load Notifications.'),
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user