diff --git a/lib/src/message_input.dart b/lib/src/message_input.dart index 13f8291c..20a2bdf6 100644 --- a/lib/src/message_input.dart +++ b/lib/src/message_input.dart @@ -93,6 +93,8 @@ class MessageInput extends StatefulWidget { this.actions, this.actionsLocation = ActionsLocation.left, this.attachmentThumbnailBuilders, + this.inputTextStyle, + this.attachmentIconColor }) : super(key: key); /// Message to edit @@ -138,6 +140,13 @@ 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; + + /// Color used for attachment icon. + final Color attachmentIconColor; + @override MessageInputState createState() => MessageInputState(); @@ -276,10 +285,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, ), @@ -605,16 +616,17 @@ class MessageInputState extends State { Material _buildAttachmentButton() { return Material( clipBehavior: Clip.hardEdge, + type: MaterialType.transparency, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(32), ), - color: Colors.transparent, child: IconButton( onPressed: () { showAttachmentModal(); }, icon: Icon( Icons.add_circle_outline, + color: widget.attachmentIconColor, ), ), );