feat: commands ui
This commit is contained in:
+36
-21
@@ -415,30 +415,44 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
child: ListView(
|
child: ListView(
|
||||||
padding: const EdgeInsets.all(0),
|
padding: const EdgeInsets.all(0),
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
children: commands
|
children: [
|
||||||
.map(
|
Padding(
|
||||||
(c) => ListTile(
|
padding: const EdgeInsets.all(4.0),
|
||||||
title: Text.rich(
|
child: Row(
|
||||||
TextSpan(
|
children: [
|
||||||
text: '${c.name}',
|
Padding(
|
||||||
style: TextStyle(fontWeight: FontWeight.bold),
|
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||||
children: [
|
child: Icon(StreamIcons.lightning, color: StreamChatTheme.of(context).accentColor),
|
||||||
TextSpan(
|
),
|
||||||
text: ' ${c.args}',
|
Text('Instant Commands')
|
||||||
style: TextStyle(
|
],
|
||||||
fontWeight: FontWeight.w300,
|
),
|
||||||
),
|
),
|
||||||
|
...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);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
)
|
subtitle: Text(c.description),
|
||||||
.toList(),
|
onTap: () {
|
||||||
|
_setCommand(c);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.toList(),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -544,6 +558,7 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
_chosenCommand = c;
|
_chosenCommand = c;
|
||||||
_commandEnabled = true;
|
_commandEnabled = true;
|
||||||
|
_messageIsPresent = false;
|
||||||
});
|
});
|
||||||
_commandsOverlay?.remove();
|
_commandsOverlay?.remove();
|
||||||
_commandsOverlay = null;
|
_commandsOverlay = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user