From 0c0b469e4b0baffb9bb6f451fed86750e52209f6 Mon Sep 17 00:00:00 2001 From: Vatsal Tanna Date: Fri, 1 Nov 2024 21:03:55 +0530 Subject: [PATCH] fix: :bug: issue #196 userReactionCallback not working --- lib/src/widgets/chat_view.dart | 101 ++++++++++++++++----------------- 1 file changed, 50 insertions(+), 51 deletions(-) diff --git a/lib/src/widgets/chat_view.dart b/lib/src/widgets/chat_view.dart index aa2e3217..c65b69c5 100644 --- a/lib/src/widgets/chat_view.dart +++ b/lib/src/widgets/chat_view.dart @@ -199,42 +199,41 @@ class _ChatViewState extends State child: SuggestionsConfigIW( suggestionsConfig: widget.replySuggestionsConfig, child: Builder(builder: (context) { - return Stack( - children: [ - Container( - height: chatBackgroundConfig.height ?? - MediaQuery.of(context).size.height, - width: chatBackgroundConfig.width ?? - MediaQuery.of(context).size.width, - decoration: BoxDecoration( - color: chatBackgroundConfig.backgroundColor ?? Colors.white, - image: chatBackgroundConfig.backgroundImage != null - ? DecorationImage( - fit: BoxFit.fill, - image: NetworkImage( - chatBackgroundConfig.backgroundImage!), - ) - : null, - ), - padding: chatBackgroundConfig.padding, - margin: chatBackgroundConfig.margin, - child: Column( - children: [ - if (widget.appBar != null) widget.appBar!, - Expanded( - child: ConfigurationsInheritedWidget( - chatBackgroundConfig: widget.chatBackgroundConfig, - reactionPopupConfig: widget.reactionPopupConfig, - typeIndicatorConfig: widget.typeIndicatorConfig, - chatBubbleConfig: widget.chatBubbleConfig, - replyPopupConfig: widget.replyPopupConfig, - messageConfig: widget.messageConfig, - profileCircleConfig: widget.profileCircleConfig, - repliedMessageConfig: widget.repliedMessageConfig, - swipeToReplyConfig: widget.swipeToReplyConfig, - emojiPickerSheetConfig: widget.emojiPickerSheetConfig, - scrollToBottomButtonConfig: - widget.scrollToBottomButtonConfig, + return ConfigurationsInheritedWidget( + chatBackgroundConfig: widget.chatBackgroundConfig, + reactionPopupConfig: widget.reactionPopupConfig, + typeIndicatorConfig: widget.typeIndicatorConfig, + chatBubbleConfig: widget.chatBubbleConfig, + replyPopupConfig: widget.replyPopupConfig, + messageConfig: widget.messageConfig, + profileCircleConfig: widget.profileCircleConfig, + repliedMessageConfig: widget.repliedMessageConfig, + swipeToReplyConfig: widget.swipeToReplyConfig, + emojiPickerSheetConfig: widget.emojiPickerSheetConfig, + scrollToBottomButtonConfig: widget.scrollToBottomButtonConfig, + child: Stack( + children: [ + Container( + height: chatBackgroundConfig.height ?? + MediaQuery.of(context).size.height, + width: chatBackgroundConfig.width ?? + MediaQuery.of(context).size.width, + decoration: BoxDecoration( + color: chatBackgroundConfig.backgroundColor ?? Colors.white, + image: chatBackgroundConfig.backgroundImage != null + ? DecorationImage( + fit: BoxFit.fill, + image: NetworkImage( + chatBackgroundConfig.backgroundImage!), + ) + : null, + ), + padding: chatBackgroundConfig.padding, + margin: chatBackgroundConfig.margin, + child: Column( + children: [ + if (widget.appBar != null) widget.appBar!, + Expanded( child: Stack( children: [ if (chatViewState.isLoading) @@ -301,22 +300,22 @@ class _ChatViewState extends State ], ), ), - ), - ], - ), - ), - if (featureActiveConfig.enableReactionPopup) - ValueListenableBuilder( - valueListenable: context.chatViewIW!.showPopUp, - builder: (_, showPopupValue, child) { - return ReactionPopup( - key: context.chatViewIW!.reactionPopupKey, - onTap: () => _onChatListTap(context), - showPopUp: showPopupValue, - ); - }, + ], + ), ), - ], + if (featureActiveConfig.enableReactionPopup) + ValueListenableBuilder( + valueListenable: context.chatViewIW!.showPopUp, + builder: (_, showPopupValue, child) { + return ReactionPopup( + key: context.chatViewIW!.reactionPopupKey, + onTap: () => _onChatListTap(context), + showPopUp: showPopupValue, + ); + }, + ), + ], + ), ); }), ),