StreamMessageInputController class
Controller for storing and mutating a Message value.
- Inheritance
-
- Object
- ChangeNotifier
- ValueNotifier<
Message> - StreamMessageInputController
Constructors
-
StreamMessageInputController.new({Message? message, Map<
RegExp, TextStyleBuilder> ? textPatternStyle}) -
Creates a controller for an editable text field.
factory
-
StreamMessageInputController.fromAttachments(List<
Attachment> attachments, {Map<RegExp, TextStyleBuilder> ? textPatternStyle}) -
Creates a controller for an editable text field from initial
attachments
.factory -
StreamMessageInputController.fromText(String? text, {Map<
RegExp, TextStyleBuilder> ? textPatternStyle}) -
Creates a controller for an editable text field from an initial
text
.factory
Properties
-
attachments
↔ List<
Attachment> -
Returns the attachments of the message.
getter/setter pair
- command ← String
-
Sets a command for the message.
no getter
- cooldownTimeOut → int
-
The current cooldownTimeOut of the slow mode.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
-
mentionedUsers
↔ List<
User> -
Returns the list of mentioned users in the message.
getter/setter pair
- message ↔ Message
-
Returns the current message associated with this controller.
getter/setter pair
- ogAttachment → Attachment?
-
Returns the og attachment of the message if set
no setter
- poll ↔ Poll?
-
Returns the poll in the message.
getter/setter pair
- quotedMessage ← Message
-
no getter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selection ↔ TextSelection
-
The currently selected text.
getter/setter pair
- showInChannel ↔ bool
-
Returns true if the message is in a thread and
should be shown in the main channel as well.
getter/setter pair
- text ↔ String
-
Text of the message.
getter/setter pair
- textEditingValue ↔ TextEditingValue
-
Returns the textEditingValue associated with this controller.
getter/setter pair
- textFieldController → MessageTextFieldController
-
Returns the controller of the text field linked to this controller.
no setter
- value ↔ Message
-
The current value stored in this notifier.
getter/setter pairinherited-getteroverride-setter
Methods
-
addAttachment(
Attachment attachment) → void - Adds a new attachment to the message.
-
addAttachmentAt(
int index, Attachment attachment) → void -
Adds a new attachment at the specified
index
. -
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
addMentionedUser(
User user) → void - Adds a user to the list of mentioned users.
-
cancelCooldown(
) → void - Cancels the slow mode timer.
-
clear(
) → void - Sets the message, to empty.
-
clearAttachments(
) → void - Clears the message attachments.
-
clearMentionedUsers(
) → void - Removes all mentioned users from the message.
-
clearOGAttachment(
) → void - Removes the og attachment.
-
clearQuotedMessage(
) → void - Clears the quoted message.
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeAttachment(
Attachment attachment) → void -
Removes the specified
attachment
from the message. -
removeAttachmentAt(
int index) → void -
Removes the attachment at the given
index
. -
removeAttachmentById(
String attachmentId) → void -
Remove the attachment with the given
attachmentId
. -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
removeMentionedUser(
User user) → void -
Removes the specified
user
from the mentioned users list. -
removeMentionedUserById(
String userId) → void -
Removes the mentioned user with the given
userId
. -
reset(
{bool resetId = true}) → void - Sets the message to the initial Message value.
-
setOGAttachment(
Attachment attachment) → void - Sets the og attachment in the message.
-
startCooldown(
int cooldown) → void - Starts the slow mode timer.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited