diff --git a/packages/stream_chat_flutter_core/lib/src/message_input_controller.dart b/packages/stream_chat_flutter_core/lib/src/message_input_controller.dart index 3f60efaf..d49d964f 100644 --- a/packages/stream_chat_flutter_core/lib/src/message_input_controller.dart +++ b/packages/stream_chat_flutter_core/lib/src/message_input_controller.dart @@ -1,10 +1,10 @@ -import 'dart:async'; import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:stream_chat/stream_chat.dart'; +/// A Controller for storing and handling the [Message] class MessageInputController extends ValueNotifier { /// Creates a controller for an editable text field. /// @@ -17,7 +17,7 @@ class MessageInputController extends ValueNotifier { factory MessageInputController.fromText(String? text) => MessageInputController._(Message(text: text)); - /// Creates a controller for an editable text field from an initial [attachments]. + /// Creates a controller for an editable textfield from initial [attachments]. factory MessageInputController.fromAttachments( List attachments, ) => @@ -55,23 +55,17 @@ class MessageInputController extends ValueNotifier { } /// - get baseOffset { - return textEditingController.selection.baseOffset; - } + int get baseOffset => textEditingController.selection.baseOffset; /// - get selectionStart { - return textEditingController.selection.start; - } + int get selectionStart => textEditingController.selection.start; set showInChannel(bool newValue) { value = value.copyWith(showInChannel: newValue); } /// - bool get showInChannel { - return value.showInChannel ?? false; - } + bool get showInChannel => value.showInChannel ?? false; /// List get attachments => value.attachments; @@ -142,7 +136,7 @@ class MessageInputController extends ValueNotifier { /// After calling this function, [text], [attachments] and [mentionedUsers] /// all will be empty. /// - /// Calling this will notify all the listeners of this [MessageInputController] + /// Calling this will notify the listeners of this [MessageInputController] /// that they need to update (it calls [notifyListeners]). For this reason, /// this method should only be called between frames, e.g. in response to user /// actions, not during the build, layout, or paint phases.