Message class abstract
Base class for a single chat message.
Use SenderMessage for messages sent by the current user and ReceiverMessage for messages from other participants. The content of a message is a list of MessageElements, which you implement for each content type (text, image, file, ...).
- Implementers
Constructors
-
Message({required String name, required String id, String? serverUuid, required String timestamp, required List<
MessageElement> elements, bool isLoading = false, bool isFailed = false, bool? isRead, double? width}) - Creates a message. Use SenderMessage or ReceiverMessage instead.
Properties
-
elements
→ List<
MessageElement> -
Content of the message, rendered in order inside one bubble.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
Unique identifier of the message.
final
- isFailed → bool
-
Whether sending the message failed.
final
- isLoading → bool
-
Whether the message is still being sent.
final
- isRead → bool?
-
Read state of the message.
final
- isSender → bool
-
Whether this is a SenderMessage (sent by the current user).
no setter
- name → String
-
Display name of the author.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serverUuid → String?
-
Optional identifier assigned by your server.
final
- timestamp → String
-
Time the message was sent, as a string parsable by DateTime.parse
(e.g. ISO 8601).
final
- width → double?
-
Maximum width of this message's bubble.
final
Methods
-
copyWith(
{String? id, String? timestamp, bool? isLoading, List< MessageElement> ? elements, bool? isFailed, double? width, bool? isRead}) → Message - Returns a copy of this message with the given fields replaced.
-
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