import 'dart:convert'; GetAllNotificationResponseModel getAllNotificationResponseModelFromJson( String str, ) => GetAllNotificationResponseModel.fromJson(json.decode(str)); String getAllNotificationResponseModelToJson( GetAllNotificationResponseModel data, ) => json.encode(data.toJson()); class GetAllNotificationResponseModel { bool? isSuccess; int? statusCode; String? message; Data? data; dynamic errors; GetAllNotificationResponseModel({ this.isSuccess, this.statusCode, this.message, this.data, this.errors, }); factory GetAllNotificationResponseModel.fromJson(Map json) => GetAllNotificationResponseModel( isSuccess: json["isSuccess"], statusCode: json["statusCode"], message: json["message"], data: json["data"] == null ? null : Data.fromJson(json["data"]), errors: json["errors"], ); Map toJson() => { "isSuccess": isSuccess, "statusCode": statusCode, "message": message, "data": data?.toJson(), "errors": errors, }; } class Data { int? totalCount; List? items; int? totalUnseenCount; Data({this.totalCount, this.items, this.totalUnseenCount}); factory Data.fromJson(Map json) => Data( totalCount: json["totalCount"], items: json["items"] == null ? [] : List.from( json["items"]!.map((x) => NotificationItem.fromJson(x)), ), totalUnseenCount: json["totalUnseenCount"], ); Map toJson() => { "totalCount": totalCount, "items": items == null ? [] : List.from(items!.map((x) => x.toJson())), "totalUnseenCount": totalUnseenCount, }; } class NotificationItem { int? notificationId; String? notificationTitle; int? notificationType; String? notificationTypeName; String? userId; bool? isSeen; String? dataField; String? createdAt; NotificationItem({ this.notificationId, this.notificationTitle, this.notificationType, this.notificationTypeName, this.userId, this.isSeen, this.dataField, this.createdAt, }); factory NotificationItem.fromJson(Map json) => NotificationItem( notificationId: json["notificationID"], notificationTitle: json["notificationTitle"], notificationType: json["notificationType"], notificationTypeName: json["notificationTypeName"], userId: json["userID"], isSeen: json["isSeen"], dataField: json["dataField"], createdAt: json["createdAt"], ); Map toJson() => { "notificationID": notificationId, "notificationTitle": notificationTitle, "notificationType": notificationType, "notificationTypeName": notificationTypeName, "userID": userId, "isSeen": isSeen, "dataField": dataField, "createdAt": createdAt, }; }