MessageInput class

Inactive state screenshot screenshot Focused state screenshot screenshot

Widget used to enter the message and add attachments

class ChannelPage extends StatelessWidget {
  const ChannelPage({
    Key key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: ChannelHeader(),
      body: Column(
        children: <Widget>[
          Expanded(
            child: MessageListView(
              threadBuilder: (_, parentMessage) {
                return ThreadPage(
                  parent: parentMessage,
                );
              },
            ),
          ),
          MessageInput(),
        ],
      ),
    );
  }
}

You usually put this widget in the same page of a MessageListView as the bottom widget.

The widget renders the ui based on the first ancestor of type StreamChatTheme. Modify it to change the widget appearance.

Inheritance

Constructors

MessageInput({Key key, void onMessageSent(Message), Message parentMessage, Message editMessage, double maxHeight: 150, TextInputType keyboardType: TextInputType.multiline, bool disableAttachments: false, FileUploader doImageUploadRequest, FileUploader doFileUploadRequest, Message initialMessage})

Properties

disableAttachments bool
If true the attachments button will not be displayed
final
doFileUploadRequest FileUploader
Override file upload request
final
doImageUploadRequest FileUploader
Override image upload request
final
editMessage Message
Message to edit
final
hashCode int
The hash code for this object. [...]
@nonVirtual, read-only, inherited
initialMessage Message
Message to start with
final
key Key
Controls how one widget replaces another widget in the tree. [...]
final, inherited
keyboardType TextInputType
The keyboard type assigned to the TextField
final
maxHeight double
Maximum Height for the TextField to grow before it starts scrolling
final
onMessageSent → void Function(Message)
Function called after sending the message
final
parentMessage Message
Parent message in case of a thread
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree. [...]
inherited
createState() → _MessageInputState
Creates the mutable state for this widget at a given location in the tree. [...]
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children. [...]
@protected, inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toDiagnosticsNode({String name, DiagnosticsTreeStyle style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep. [...]
inherited
toString({DiagnosticLevel minLevel: DiagnosticLevel.info}) String
Returns a string representation of this object.
inherited
toStringDeep({String prefixLineOne: '', String prefixOtherLines, DiagnosticLevel minLevel: DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants. [...]
inherited
toStringShallow({String joiner: ', ', DiagnosticLevel minLevel: DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object. [...]
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
@nonVirtual, inherited