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.actionsLocation = ActionsLocation.left,
this.attachmentThumbnailBuilders,
this.inputTextStyle,
}) : super(key: key);
/// Message to edit
@@ -138,6 +139,10 @@ class MessageInput extends StatefulWidget {
/// Map that defines a thumbnail builder for an attachment type
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
MessageInputState createState() => MessageInputState();
@@ -276,10 +281,12 @@ class MessageInputState extends State<MessageInput> {
_typingStarted = true;
});
},
style: Theme.of(context).textTheme.bodyText2,
style: widget.inputTextStyle ?? Theme.of(context).textTheme.bodyText2,
autofocus: false,
decoration: InputDecoration(
hintText: 'Write a message',
hintStyle: widget.inputTextStyle ??
Theme.of(context).textTheme.bodyText2,
prefixText: ' ',
border: InputBorder.none,
),