sendAsDm changes
This commit is contained in:
@@ -44,11 +44,26 @@ class MessageInputController extends ValueNotifier<Message> {
|
||||
_textEditingController.text = newText ?? '';
|
||||
}
|
||||
|
||||
///
|
||||
set textEditingValue(TextEditingValue newValue) {
|
||||
_textEditingController.value = newValue;
|
||||
value = value.copyWith(text: _textEditingController.text);
|
||||
}
|
||||
|
||||
///
|
||||
get baseOffset {
|
||||
return textEditingController.selection.baseOffset;
|
||||
}
|
||||
|
||||
set showInChannel(bool newValue) {
|
||||
value = value.copyWith(showInChannel: newValue);
|
||||
}
|
||||
|
||||
///
|
||||
bool get showInChannel {
|
||||
return value.showInChannel ?? false;
|
||||
}
|
||||
|
||||
///
|
||||
List<Attachment> get attachments => value.attachments;
|
||||
|
||||
@@ -56,11 +71,6 @@ class MessageInputController extends ValueNotifier<Message> {
|
||||
value = value.copyWith(attachments: attachments);
|
||||
}
|
||||
|
||||
///
|
||||
get baseOffset {
|
||||
return textEditingController.selection.baseOffset;
|
||||
}
|
||||
|
||||
///
|
||||
void addAttachment(Attachment attachment) {
|
||||
attachments = [...attachments, attachment];
|
||||
@@ -86,6 +96,11 @@ class MessageInputController extends ValueNotifier<Message> {
|
||||
attachments = [...attachments]..removeAt(index);
|
||||
}
|
||||
|
||||
///
|
||||
void clearAttachments() {
|
||||
attachments = [];
|
||||
}
|
||||
|
||||
///
|
||||
List<User> get mentionedUsers => value.mentionedUsers;
|
||||
|
||||
@@ -108,6 +123,11 @@ class MessageInputController extends ValueNotifier<Message> {
|
||||
mentionedUsers = [...mentionedUsers]..removeWhere((it) => it.id == userId);
|
||||
}
|
||||
|
||||
///
|
||||
void clearMentionedUsers() {
|
||||
mentionedUsers = [];
|
||||
}
|
||||
|
||||
/// Set the [value] to empty.
|
||||
///
|
||||
/// After calling this function, [text], [attachments] and [mentionedUsers]
|
||||
|
||||
Reference in New Issue
Block a user