From ede6af99476a045d1e5cd14ebda925635aded5c6 Mon Sep 17 00:00:00 2001 From: Deven Joshi Date: Fri, 16 Oct 2020 15:45:00 +0530 Subject: [PATCH] feat: wip message input --- lib/src/message_input.dart | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/lib/src/message_input.dart b/lib/src/message_input.dart index c2d7506e..8ad19388 100644 --- a/lib/src/message_input.dart +++ b/lib/src/message_input.dart @@ -222,7 +222,7 @@ class MessageInputState extends State { ? CrossFadeState.showFirst : CrossFadeState.showSecond, firstChild: _buildSendButton(context), - secondChild: SizedBox(), + secondChild: _buildIdleSendButton(context), duration: Duration(milliseconds: 300), alignment: Alignment.center, ); @@ -617,7 +617,7 @@ class MessageInputState extends State { child: Icon( Icons.attach_file_sharp, ), - angle: - 0.3, + angle: 0.4, ), ), ); @@ -835,6 +835,30 @@ class MessageInputState extends State { return res.file; } + Widget _buildIdleSendButton(BuildContext context) { + return IconTheme( + data: + StreamChatTheme.of(context).channelTheme.messageInputButtonIconTheme, + child: Material( + clipBehavior: Clip.hardEdge, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(32), + ), + color: Colors.grey, + child: IconButton( + key: Key('sendButton'), + onPressed: () { + sendMessage(); + }, + icon: Icon( + Icons.arrow_forward, + color: Colors.white, + ), + ), + ), + ); + } + Widget _buildSendButton(BuildContext context) { return IconTheme( data: @@ -844,15 +868,15 @@ class MessageInputState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(32), ), - color: Colors.transparent, + color: StreamChatTheme.of(context).accentColor, child: IconButton( key: Key('sendButton'), onPressed: () { sendMessage(); }, icon: Icon( - Icons.send, - color: StreamChatTheme.of(context).accentColor, + Icons.arrow_upward, + color: Colors.white, ), ), ),