Skip to content

Commit

Permalink
feat: ✨ hide share icon for image view
Browse files Browse the repository at this point in the history
  • Loading branch information
vatsaltanna authored and vatsaltanna-simformsolutions committed Jul 17, 2024
1 parent 2c70e16 commit e6d672f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
13 changes: 9 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
## [2.0.1]

* **Feat** [223](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/223) ability to
hide share icon in image view

## [2.0.0]

* **Breaking**: [203](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/pull/203) Dart
* **Breaking**: [203](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/pull/203) Dart
Minimum Version 3.2.0.
* **Breaking**: [202](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/pull/202)
* **Breaking**: [202](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/pull/202)
Message copyWith id value fix.
* **Breaking**: [173](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/pull/173) Added
callback to sort message in chat.
Expand All @@ -25,7 +30,7 @@
for configuring the audio recording quality.
* **Feat**: [93](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/93) Added support
that provide date pattern to change chat separation.
* **Fix**: [200](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/pull/200) ChatView
* **Fix**: [200](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/pull/200) ChatView
iOS Padding Issue Fix
* **Fix**: [139](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/139) Added
support to customize view for the reply of any message.
Expand Down Expand Up @@ -60,7 +65,7 @@
send to closed socket or animate on `ScrollController` without clients.
* **Fix**: [194](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/pull/194) Dispose
all `ValueNotifier`s and `ScrollController`s in `ChatController`.
* **chore**: [168](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/pull/168) Update
* **chore**: [168](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/pull/168) Update
intl to version 0.19.0.

## [1.3.1]
Expand Down
4 changes: 4 additions & 0 deletions lib/src/models/image_message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class ImageMessageConfiguration {
/// Provides configuration of share button while image message is appeared.
final ShareIconConfiguration? shareIconConfig;

/// Hide share icon in image view.
final bool hideShareIcon;

/// Provides callback when user taps on image message.
final StringCallback? onTap;

Expand All @@ -46,6 +49,7 @@ class ImageMessageConfiguration {
final BorderRadius? borderRadius;

const ImageMessageConfiguration({
this.hideShareIcon = false,
this.shareIconConfig,
this.onTap,
this.height,
Expand Down
4 changes: 2 additions & 2 deletions lib/src/widgets/image_message_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class ImageMessageView extends StatelessWidget {
mainAxisAlignment:
isMessageBySender ? MainAxisAlignment.end : MainAxisAlignment.start,
children: [
if (isMessageBySender) iconButton,
if (isMessageBySender && !(imageMessageConfig?.hideShareIcon ?? false)) iconButton,
Stack(
children: [
GestureDetector(
Expand Down Expand Up @@ -141,7 +141,7 @@ class ImageMessageView extends StatelessWidget {
),
],
),
if (!isMessageBySender) iconButton,
if (!isMessageBySender && !(imageMessageConfig?.hideShareIcon ?? false)) iconButton,
],
);
}
Expand Down

0 comments on commit e6d672f

Please sign in to comment.