expose input text style

This commit is contained in:
Neevash Ramdial
2020-11-15 21:33:51 -04:00
parent 13604cee38
commit 78e23bc256
+8 -1
View File
@@ -93,6 +93,7 @@ class MessageInput extends StatefulWidget {
this.actions, this.actions,
this.actionsLocation = ActionsLocation.left, this.actionsLocation = ActionsLocation.left,
this.attachmentThumbnailBuilders, this.attachmentThumbnailBuilders,
this.inputTextStyle,
}) : super(key: key); }) : super(key: key);
/// Message to edit /// Message to edit
@@ -138,6 +139,10 @@ class MessageInput extends StatefulWidget {
/// Map that defines a thumbnail builder for an attachment type /// Map that defines a thumbnail builder for an attachment type
final Map<String, AttachmentThumbnailBuilder> attachmentThumbnailBuilders; final Map<String, AttachmentThumbnailBuilder> attachmentThumbnailBuilders;
/// Text style used in message text field. If null, [MessageInput] uses
/// `Theme.of(context).textTheme.bodyText2`.
final TextStyle inputTextStyle;
@override @override
MessageInputState createState() => MessageInputState(); MessageInputState createState() => MessageInputState();
@@ -276,10 +281,12 @@ class MessageInputState extends State<MessageInput> {
_typingStarted = true; _typingStarted = true;
}); });
}, },
style: Theme.of(context).textTheme.bodyText2, style: widget.inputTextStyle ?? Theme.of(context).textTheme.bodyText2,
autofocus: false, autofocus: false,
decoration: InputDecoration( decoration: InputDecoration(
hintText: 'Write a message', hintText: 'Write a message',
hintStyle: widget.inputTextStyle ??
Theme.of(context).textTheme.bodyText2,
prefixText: ' ', prefixText: ' ',
border: InputBorder.none, border: InputBorder.none,
), ),