From 6998d4e9ccfe7f2bfdcc987a37e3c80810491c49 Mon Sep 17 00:00:00 2001 From: Deven Joshi Date: Mon, 19 Oct 2020 13:45:43 +0530 Subject: [PATCH] fix: Disable giphy button when editing, change close icon --- lib/src/message_actions_modal.dart | 39 +++++++----------------------- lib/src/message_input.dart | 2 +- 2 files changed, 10 insertions(+), 31 deletions(-) diff --git a/lib/src/message_actions_modal.dart b/lib/src/message_actions_modal.dart index 31086885..569ae22e 100644 --- a/lib/src/message_actions_modal.dart +++ b/lib/src/message_actions_modal.dart @@ -193,37 +193,16 @@ class MessageActionsModal extends StatelessWidget { 'Edit message', style: Theme.of(context).textTheme.headline6, ), - Container( - height: 30, - padding: const EdgeInsets.all(2.0), - child: AspectRatio( - aspectRatio: 1, - child: RawMaterialButton( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(4), - ), - elevation: 0, - highlightElevation: 0, - focusElevation: 0, - disabledElevation: 0, - hoverElevation: 0, - onPressed: () { - Navigator.of(context).pop(); - }, - fillColor: - Theme.of(context).brightness == Brightness.dark - ? Colors.white.withOpacity(.1) - : Colors.black.withOpacity(.1), - padding: EdgeInsets.all(4), - child: Icon( - Icons.close, - size: 15, - color: StreamChatTheme.of(context) - .primaryIconTheme - .color, - ), - ), + IconButton( + icon: Icon( + Icons.cancel_outlined, + size: 15, + color: + StreamChatTheme.of(context).primaryIconTheme.color, ), + onPressed: () { + Navigator.of(context).pop(); + }, ), ], ), diff --git a/lib/src/message_input.dart b/lib/src/message_input.dart index 3ad57dfe..a17874ff 100644 --- a/lib/src/message_input.dart +++ b/lib/src/message_input.dart @@ -205,7 +205,7 @@ class MessageInputState extends State { mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ if (!widget.disableAttachments) _buildAttachmentButton(), - _buildGiphyButton(), + if (widget.editMessage != null) _buildGiphyButton(), ], ), if (widget.actionsLocation == ActionsLocation.left)