fix: Fixed message input

This commit is contained in:
Deven Joshi
2020-12-08 17:21:20 +05:30
parent e80a30dca4
commit 3394126adf
+35 -12
View File
@@ -354,7 +354,7 @@ class MessageInputState extends State<MessageInput> {
child: Container( child: Container(
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(24.0),
border: Border.all( border: Border.all(
color: Colors.grey, color: Colors.grey,
), ),
@@ -404,26 +404,45 @@ class MessageInputState extends State<MessageInput> {
child: Chip( child: Chip(
backgroundColor: backgroundColor:
StreamChatTheme.of(context).accentColor, StreamChatTheme.of(context).accentColor,
label: Text( padding: EdgeInsets.zero,
_chosenCommand?.name ?? "", labelPadding:
style: TextStyle(color: Colors.white), EdgeInsets.symmetric(horizontal: 9.0),
), label: Row(
avatar: StreamSvgIcon.lightning( mainAxisSize: MainAxisSize.min,
color: Colors.white, mainAxisAlignment: MainAxisAlignment.center,
children: [
StreamSvgIcon.lightning(
color: Colors.white,
size: 16.0,
),
Text(
_chosenCommand?.name?.toUpperCase() ?? "",
style: TextStyle(
color: Colors.white, fontSize: 12.0),
),
],
), ),
), ),
) )
: null, : null,
suffixIcon: _commandEnabled suffixIcon: _commandEnabled
? IconButton( ? InkWell(
icon: Icon(Icons.cancel_outlined), child: Padding(
onPressed: () { padding:
const EdgeInsets.symmetric(horizontal: 8.0),
child: StreamSvgIcon.close_small(),
),
onTap: () {
setState(() { setState(() {
_commandEnabled = false; _commandEnabled = false;
}); });
}, },
) )
: null, : null,
suffixIconConstraints: BoxConstraints(
maxHeight: 24.0,
maxWidth: 40.0,
),
), ),
textCapitalization: TextCapitalization.sentences, textCapitalization: TextCapitalization.sentences,
), ),
@@ -1784,7 +1803,7 @@ class MessageInputState extends State<MessageInput> {
Widget _buildIdleSendButton(BuildContext context) { Widget _buildIdleSendButton(BuildContext context) {
return Padding( return Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0) + EdgeInsets.only(bottom: 3.0),
child: Center( child: Center(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
@@ -1793,6 +1812,8 @@ class MessageInputState extends State<MessageInput> {
child: StreamSvgIcon( child: StreamSvgIcon(
assetName: _getIdleSendIcon(), assetName: _getIdleSendIcon(),
color: Colors.grey, color: Colors.grey,
height: 24.0,
width: 24.0,
), ),
)), )),
); );
@@ -1801,7 +1822,7 @@ class MessageInputState extends State<MessageInput> {
Widget _buildSendButton(BuildContext context) { Widget _buildSendButton(BuildContext context) {
return Center( return Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0) + EdgeInsets.only(bottom: 3.0),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
sendMessage(); sendMessage();
@@ -1809,6 +1830,8 @@ class MessageInputState extends State<MessageInput> {
child: StreamSvgIcon( child: StreamSvgIcon(
assetName: _getSendIcon(), assetName: _getSendIcon(),
color: StreamChatTheme.of(context).accentColor, color: StreamChatTheme.of(context).accentColor,
height: 24.0,
width: 24.0,
), ),
), ),
), ),