From 00828eb0e28ec713c43efffe03dbf7e3c1b27f2d Mon Sep 17 00:00:00 2001 From: Deven Joshi Date: Fri, 23 Oct 2020 13:58:21 +0530 Subject: [PATCH] feat: commands ui --- lib/src/message_input.dart | 57 ++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/lib/src/message_input.dart b/lib/src/message_input.dart index b9af8102..2143433c 100644 --- a/lib/src/message_input.dart +++ b/lib/src/message_input.dart @@ -415,30 +415,44 @@ class MessageInputState extends State { child: ListView( padding: const EdgeInsets.all(0), shrinkWrap: true, - children: commands - .map( - (c) => ListTile( - title: Text.rich( - TextSpan( - text: '${c.name}', - style: TextStyle(fontWeight: FontWeight.bold), - children: [ - TextSpan( - text: ' ${c.args}', - style: TextStyle( - fontWeight: FontWeight.w300, - ), + children: [ + Padding( + padding: const EdgeInsets.all(4.0), + child: Row( + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Icon(StreamIcons.lightning, color: StreamChatTheme.of(context).accentColor), + ), + Text('Instant Commands') + ], + ), + ), + ...commands + .map( + (c) => ListTile( + title: Text.rich( + TextSpan( + text: '${c.name}', + style: TextStyle(fontWeight: FontWeight.bold), + children: [ + TextSpan( + text: ' ${c.args}', + style: TextStyle( + fontWeight: FontWeight.w300, ), - ], - ), + ), + ], ), - subtitle: Text(c.description), - onTap: () { - _setCommand(c); - }, ), - ) - .toList(), + subtitle: Text(c.description), + onTap: () { + _setCommand(c); + }, + ), + ) + .toList(), + ], ), ), ), @@ -544,6 +558,7 @@ class MessageInputState extends State { setState(() { _chosenCommand = c; _commandEnabled = true; + _messageIsPresent = false; }); _commandsOverlay?.remove(); _commandsOverlay = null;