From 78e23bc256f7ddb6f369559c59ae66e42d611ec5 Mon Sep 17 00:00:00 2001 From: Neevash Ramdial Date: Sun, 15 Nov 2020 21:33:51 -0400 Subject: [PATCH] expose input text style --- lib/src/message_input.dart | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/src/message_input.dart b/lib/src/message_input.dart index 78833c8c..729866ee 100644 --- a/lib/src/message_input.dart +++ b/lib/src/message_input.dart @@ -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 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 { _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, ),