Message class abstract
An abstract class that contains all variables and methods every message will have.
- Implementers
- Annotations
-
- @immutable
Constructors
-
Message({required User author, int? createdAt, required String id, Map<
String, dynamic> ? metadata, String? remoteId, Message? repliedMessage, String? roomId, bool? showStatus, Status? status, required MessageType type, int? updatedAt}) -
const
-
Message.fromJson(Map<
String, dynamic> json) -
Creates a particular message from a map (decoded JSON).
Type is determined by the
type
field.factory
Properties
-
User who sent this message.
final
- createdAt → int?
-
Created message timestamp, in ms.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
Unique ID of the message.
final
-
metadata
→ Map<
String, dynamic> ? -
Additional custom metadata or attributes related to the message.
final
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setterinherited
- remoteId → String?
-
Unique ID of the message received from the backend.
final
- repliedMessage → Message?
-
Message that is being replied to with the current message.
final
- roomId → String?
-
ID of the room where this message is sent.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showStatus → bool?
-
Show status or not.
final
- status → Status?
-
Message Status.
final
- stringify → bool?
-
If set to
true
, the toString method will be overridden to output this instance's props.no setterinherited - type → MessageType
-
MessageType.
final
- updatedAt → int?
-
Updated message timestamp, in ms.
final
Methods
-
copyWith(
{User? author, int? createdAt, String? id, Map< String, dynamic> ? metadata, String? remoteId, Message? repliedMessage, String? roomId, bool? showStatus, Status? status, int? updatedAt}) → Message - Creates a copy of the message with an updated data.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts a particular message to the map representation, serializable to JSON.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited