ChatModel class

A chat message as stored in and read from a ChatBackend.

Constructors

ChatModel({required String? id, required String? message, required String? image, required int? senderId})
Creates a ChatModel with the given field values.

Properties

hashCode int
The hash code for this object.
no setterinherited
id String?
The backend document/row id of the message.
getter/setter pair
image String?
The URL of an attached image, if any.
getter/setter pair
message String?
The text content of the message.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
senderId int?
The id of the user who sent the message.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

jsonFrom(ChatMessage m, Object timestamp) Map<String, dynamic>
Converts a ChatMessage from dash_chat_custom into the JSON map used to persist a chat message document/row. timestamp is supplied by the backend so it can use its own server-time convention (e.g. FieldValue.serverTimestamp() for Firestore, or an ISO-8601 string for Appwrite/Supabase).