FileMessage class
A class that represents file message.
Constructors
-
FileMessage({required User author, int? createdAt, required String id, Map<
String, dynamic> ? metadata, String? mimeType, required String name, String? roomId, required int size, Status? status, int? updatedAt, required String uri}) -
Creates a file message.
const
-
FileMessage.fromJson(Map<
String, dynamic> json) - Creates a file message from a map (decoded JSON).
- FileMessage.fromPartial({required User author, int? createdAt, required String id, required PartialFile partialFile, String? roomId, Status? status, int? updatedAt})
- Creates a full file message from a partial one.
Properties
-
User who sent this message
finalinherited
- createdAt → int?
-
Created message timestamp, in ms
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
Unique ID of the message
finalinherited
-
metadata
→ Map<
String, dynamic> ? -
Additional custom metadata or attributes related to the message
finalinherited
- mimeType → String?
-
Media type
final
- name → String
-
The name of the file
final
-
props
→ List<
Object?> -
Equatable props
no setter
- roomId → String?
-
ID of the room where this message is sent
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → int
-
Size of the file in bytes
final
- status → Status?
-
Message Status
finalinherited
- stringify → bool?
-
If set to
true
, the toString method will be overridden to output this instance's props.no setterinherited - type → MessageType
-
MessageType
finalinherited
- updatedAt → int?
-
Updated message timestamp, in ms
finalinherited
- uri → String
-
The file source (either a remote URL or a local resource)
final
Methods
-
copyWith(
{Map< String, dynamic> ? metadata, PreviewData? previewData, Status? status, String? text, int? updatedAt}) → Message -
Creates a copy of the file message with an updated data.
metadata
with null value will nullify existing metadata, otherwise both metadatas will be merged into one Map, where keys from a passed metadata will overwite keys from the previous one.previewData
is ignored for this message type.status
with null value will be overwritten by the previous status.text
is ignored for this message type.updatedAt
with null value will nullify existing value.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Converts a file message to the map representation, encodable to JSON.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited