diff --git a/CHANGELOG.md b/CHANGELOG.md index 65bc2304..2134134d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,13 @@ ## [2.0.1] -* **Fix**: [226](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/226) Fixed +* **Fix**: [226](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/226) Fixed the icons for starting and stopping recording were reversed * **Fix**: [217](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/pull/217) Fixed y position of reaction popup * **Feat** [223](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/223) Ability to hide share icon in image view +* **Feat** [228](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/228) Ability to + completely override userReactionCallback ## [2.0.0] diff --git a/lib/src/models/reaction_popup_configuration.dart b/lib/src/models/reaction_popup_configuration.dart index 5854b8d9..8df12e50 100644 --- a/lib/src/models/reaction_popup_configuration.dart +++ b/lib/src/models/reaction_popup_configuration.dart @@ -54,8 +54,12 @@ class ReactionPopupConfiguration { /// Provides callback when user react on message. final ReactionCallback? userReactionCallback; + /// Provides feasibility to completely override userReactionCallback defaults to false. + final bool? overrideUserReactionCallback; + const ReactionPopupConfiguration({ this.userReactionCallback, + this.overrideUserReactionCallback = false, this.showGlassMorphismEffect = false, this.backgroundColor, this.shadow, diff --git a/lib/src/widgets/reaction_popup.dart b/lib/src/widgets/reaction_popup.dart index d7330300..4e6841e1 100644 --- a/lib/src/widgets/reaction_popup.dart +++ b/lib/src/widgets/reaction_popup.dart @@ -147,11 +147,13 @@ class ReactionPopupState extends State onEmojiTap: (emoji) { widget.onTap(); if (currentUser != null && _message != null) { - chatController?.setReaction( - emoji: emoji, - messageId: _message!.id, - userId: currentUser!.id, - ); + if (!(reactionPopupConfig?.overrideUserReactionCallback ?? false)) { + chatController?.setReaction( + emoji: emoji, + messageId: _message!.id, + userId: currentUser!.id, + ); + } reactionPopupConfig?.userReactionCallback?.call( _message!, emoji,