ZdsMessage class
Message model for ZdsChatMessage.
Constructors
-
ZdsMessage({required DateTime? time, ZdsChatMessageStatus status = ZdsChatMessageStatus.unknown, String senderName = '', String? content, bool isDeleted = false, Map<
String, int> reacts = const {}, Color? senderColor, List<String> tags = const [], ZdsChatAttachment? attachment, bool isInfo = false, bool isForwarded = false, ZdsMessage? replyMessageInfo, String id = ''}) -
Constructs a ZdsMessage.
const
-
ZdsMessage.attachment({required ZdsChatMessageStatus status, required DateTime? time, required ZdsChatAttachment? attachment, String? text, String senderName = '', bool isDeleted = false, Map<
String, int> reacts = const {}, Color? senderColor, List<String> tags = const [], bool isForwarded = false, ZdsMessage? replyMessageInfo, String id = ''}) - Constructs a ZdsMessage with an attachment.
-
ZdsMessage.audioLocal({required ZdsChatMessageStatus status, required DateTime? time, required String filePath, String? fileName, String? text, String senderName = '', bool isDeleted = false, Map<
String, int> reacts = const {}, Color? senderColor, List<String> tags = const [], bool isForwarded = false, ZdsMessage? replyMessageInfo, String id = ''}) - Constructs a message with audio attachment with a local file path.
-
ZdsMessage.audioNetwork({required ZdsChatMessageStatus status, required DateTime? time, required Uri url, String? fileName, String? text, String senderName = '', bool isDeleted = false, Map<
String, int> reacts = const {}, Color? senderColor, List<String> tags = const [], bool isForwarded = false, ZdsMessage? replyMessageInfo, String id = ''}) - Constructs a message with an audio attachment with a network url.
- ZdsMessage.blank()
-
Constructs a blank message. Should not normally be used.
const
-
ZdsMessage.imageBase64({required ZdsChatMessageStatus status, required DateTime? time, required String image, required String imageName, String? text, String senderName = '', bool isDeleted = false, Map<
String, int> reacts = const {}, Color? senderColor, List<String> tags = const [], bool isForwarded = false, ZdsMessage? replyMessageInfo, String id = ''}) - Constructs a message with an image attachment as a base64 image.
-
ZdsMessage.imageLocal({required ZdsChatMessageStatus status, required DateTime? time, required String filePath, String? fileName, String? text, String senderName = '', bool isDeleted = false, Map<
String, int> reacts = const {}, Color? senderColor, List<String> tags = const [], bool isForwarded = false, ZdsMessage? replyMessageInfo, String id = ''}) - Constructs a message with an image attachment with a local file path.
-
ZdsMessage.imageNetwork({required ZdsChatMessageStatus status, required DateTime? time, required Uri url, String? fileName, String? text, String senderName = '', bool isDeleted = false, Map<
String, int> reacts = const {}, Color? senderColor, List<String> tags = const [], bool isForwarded = false, ZdsMessage? replyMessageInfo, String id = ''}) - Constructs a message with an image attachment with a network url.
- ZdsMessage.info({required String? content, DateTime? time, String id = ''})
-
Constructs an info message used to display updates to user. Message not from another user.
const
-
ZdsMessage.text({required ZdsChatMessageStatus status, required DateTime? time, required String? content, String senderName = '', bool isDeleted = false, Map<
String, int> reacts = const {}, Color? senderColor, List<String> tags = const [], bool isForwarded = false, ZdsMessage? replyMessageInfo, String id = ''}) -
Constructs a Text only message.
const
-
ZdsMessage.videoLocal({required ZdsChatMessageStatus status, required DateTime? time, required String filePath, String? fileName, String? text, String senderName = '', bool isDeleted = false, Map<
String, int> reacts = const {}, Color? senderColor, List<String> tags = const [], bool isForwarded = false, ZdsMessage? replyMessageInfo, String id = ''}) - Constructs a message with a video attachment with a local file path.
-
ZdsMessage.videoNetwork({required ZdsChatMessageStatus status, required DateTime? time, required Uri url, String? fileName, String? text, String senderName = '', bool isDeleted = false, Map<
String, int> reacts = const {}, Color? senderColor, List<String> tags = const [], bool isForwarded = false, ZdsMessage? replyMessageInfo, String id = ''}) - Constructs a message with a video attachment with a network url.
Properties
- attachment → ZdsChatAttachment?
-
Attachment. Typically a document, image, video or voice note.
final
- content → String?
-
Text content of message.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasReacts → bool
-
True if message has any reacts.
no setter
- id → String
-
Unique ID of message.
final
- isDeleted → bool
-
True if message has been deleted.
final
- isForwarded → bool
-
True if message has been forwarded.
final
- isInfo → bool
-
True if message is an information message, not a chat message.
final
-
reacts
→ Map<
String, int> -
Map of reactions to number of times received.
final
- replyMessageInfo → ZdsMessage?
-
Contents of message that is being replied to.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- senderColor → Color?
-
Optional custom color used to display sender name.
final
- senderName → String
-
Name to display for sender.
final
- status → ZdsChatMessageStatus
-
ZdsChatMessageStatus of message.
final
-
List of tags.
final
- time → DateTime?
-
Time message was sent.
final
- type → ZdsChatMessageType
-
ZdsChatMessageType
of message.no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
timeString(
BuildContext context) → String - Returns formatted Date / Time string based on device preference.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited