NotificationModel class

Inheritance
Annotations
  • @JsonSerializable.new(explicitToJson: true)

Constructors

NotificationModel({String id = '', required String title, required String message, required String userId, bool isRead = false, NotificationPriority priority = NotificationPriority.medium, DateTime? createdAt})
NotificationModel.fromFirestore(DocumentSnapshot<Object?> doc)
factory
NotificationModel.fromJson(Map<String, dynamic> json)
factory

Properties

createdAt DateTime?
final
hashCode int
The hash code for this object.
no setterinherited
id String
final
isRead bool
final
message String
final
priority NotificationPriority
Uses logging strategy to track when unknown priorities appear
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title String
final
userId String
final

Methods

copyWith({String? id, String? title, String? message, String? userId, bool? isRead, NotificationPriority? priority, DateTime? createdAt}) NotificationModel
getCreateTimestampFields() List<String>
Fields that should only be set on document creation (like createdAt).
override
getUpdateTimestampFields() List<String>
Fields that should always be updated with server timestamp (like updatedAt).
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
postProcessJson(Map<String, dynamic> json, SerializationContext context) Map<String, dynamic>
Override to add custom post-processing for specific models.
inherited
toCallable() Map<String, dynamic>
Convert for Firebase callable functions.
inherited
toFirestore({bool isUpdate = false}) Map<String, dynamic>
Legacy method for Firestore conversion.
inherited
toFirestoreCreate({bool useServerTimestamp = true, List<String>? fieldsToExclude}) Map<String, dynamic>
Convert to Firestore document for CREATE operations.
inherited
toFirestoreRaw({List<String>? fieldsToExclude}) Map<String, dynamic>
Convert to Firestore with explicit control (advanced use).
inherited
toFirestoreUpdate({List<String>? fieldsToExclude}) Map<String, dynamic>
Convert to Firestore document for UPDATE operations.
inherited
toJson() Map<String, dynamic>
The single generated toJson method from json_serializable. This should be implemented by the generated code.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited