From a770f7081129d57733c91610e297d9f84cbd4884 Mon Sep 17 00:00:00 2001 From: Vatsal Tanna Date: Thu, 31 Oct 2024 21:51:47 +0530 Subject: [PATCH] refactor: :hammer: update onTap callback in ImageMessageConfiguration to use message object instead of image URL (#271) --- CHANGELOG.md | 4 +++- lib/src/models/config_models/image_message_configuration.dart | 2 +- lib/src/widgets/image_message_view.dart | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df20831a..af18dba8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ -## [2.2.1] +## [2.3.0] +* **Breaking**: [257](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/257) update + onTap callback in ImageMessageConfiguration to use message object instead of image URL * **Fix**: [254](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/254) Outgoing Message Alignment * **Fix**: [266](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/pull/266) Update diff --git a/lib/src/models/config_models/image_message_configuration.dart b/lib/src/models/config_models/image_message_configuration.dart index 8e5e48d3..00716a55 100644 --- a/lib/src/models/config_models/image_message_configuration.dart +++ b/lib/src/models/config_models/image_message_configuration.dart @@ -31,7 +31,7 @@ class ImageMessageConfiguration { final bool hideShareIcon; /// Provides callback when user taps on image message. - final StringCallback? onTap; + final MessageCallBack? onTap; /// Used for giving height of image message. final double? height; diff --git a/lib/src/widgets/image_message_view.dart b/lib/src/widgets/image_message_view.dart index aaf139ca..2464398e 100644 --- a/lib/src/widgets/image_message_view.dart +++ b/lib/src/widgets/image_message_view.dart @@ -78,7 +78,7 @@ class ImageMessageView extends StatelessWidget { children: [ GestureDetector( onTap: () => imageMessageConfig?.onTap != null - ? imageMessageConfig?.onTap!(imageUrl) + ? imageMessageConfig?.onTap!(message) : null, child: Transform.scale( scale: highlightImage ? highlightScale : 1.0,