feat: Fixed lightning button
This commit is contained in:
@@ -207,7 +207,7 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
children: [
|
children: [
|
||||||
if (!widget.disableAttachments) _buildAttachmentButton(),
|
if (!widget.disableAttachments) _buildAttachmentButton(),
|
||||||
if (widget.editMessage == null) _buildGiphyButton(),
|
if (widget.editMessage == null) _buildCommandButton(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (widget.actionsLocation == ActionsLocation.left)
|
if (widget.actionsLocation == ActionsLocation.left)
|
||||||
@@ -519,6 +519,7 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _setCommand(Command c) {
|
void _setCommand(Command c) {
|
||||||
|
textEditingController.clear();
|
||||||
setState(() {
|
setState(() {
|
||||||
chosenCommand = c;
|
chosenCommand = c;
|
||||||
_commandEnabled = true;
|
_commandEnabled = true;
|
||||||
@@ -645,7 +646,7 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildGiphyButton() {
|
Widget _buildCommandButton() {
|
||||||
return Center(
|
return Center(
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
@@ -654,9 +655,10 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
child: Icon(StreamIcons.lightning),
|
child: Icon(StreamIcons.lightning),
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
setState(() {
|
if(_commandsOverlay == null) {
|
||||||
_commandEnabled = true;
|
_commandsOverlay = _buildCommandsOverlayEntry();
|
||||||
});
|
Overlay.of(context).insert(_commandsOverlay);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user