diff --git a/packages/stream_chat_flutter/CHANGELOG.md b/packages/stream_chat_flutter/CHANGELOG.md index 66057847..6bc7a25f 100644 --- a/packages/stream_chat_flutter/CHANGELOG.md +++ b/packages/stream_chat_flutter/CHANGELOG.md @@ -1,8 +1,16 @@ ## Upcomming +🔄 Changed + +- Updated `lottie` dependency to `^2.0.0` +- Updated `desktop_drop` dependency to `^0.4.0` +- Updated `connectivity_plus` dependency to `^3.0.2` + 🐞 Fixed +- [[#1379]](https://github.com/GetStream/stream-chat-flutter/issues/1379) Fixed "Issues with photo attachments on web", where the cached image attachment would not render while uploading. - Fix render overflow issue with `MessageSearchListTileTitle`. It now uses `Text.rich` instead of `Row`. Better default behaviour and allows `TextOverflow`. - [[1346]](https://github.com/GetStream/stream-chat-flutter/issues/1346) Fixed a render issue while uploading video on web. +- [[#1347]](https://github.com/GetStream/stream-chat-flutter/issues/1347) `onReply` not working in `AttachmentActionsModal` which is used by `StreamImageAttachment` and `StreamImageGroup`. ## 5.1.0 diff --git a/packages/stream_chat_flutter/example/lib/main.dart b/packages/stream_chat_flutter/example/lib/main.dart index 67420d06..c8978a45 100644 --- a/packages/stream_chat_flutter/example/lib/main.dart +++ b/packages/stream_chat_flutter/example/lib/main.dart @@ -300,6 +300,7 @@ class _ChannelPageState extends State { @override void dispose() { focusNode.dispose(); + messageInputController.dispose(); super.dispose(); } } diff --git a/packages/stream_chat_flutter/lib/src/attachment/image_attachment.dart b/packages/stream_chat_flutter/lib/src/attachment/image_attachment.dart index 93bf2926..6a6ee780 100644 --- a/packages/stream_chat_flutter/lib/src/attachment/image_attachment.dart +++ b/packages/stream_chat_flutter/lib/src/attachment/image_attachment.dart @@ -56,22 +56,33 @@ class StreamImageAttachment extends StreamAttachmentWidget { Widget build(BuildContext context) { return source.when( local: () { - if (attachment.localUri == null || attachment.file?.bytes == null) { - return AttachmentError(constraints: constraints); - } - return _buildImageAttachment( - context, - Image.memory( - attachment.file!.bytes!, - height: constraints?.maxHeight, - width: constraints?.maxWidth, - fit: BoxFit.cover, - errorBuilder: (context, _, __) => Image.asset( - 'images/placeholder.png', - package: 'stream_chat_flutter', + if (attachment.file?.bytes != null) { + return _buildImageAttachment( + context, + Image.memory( + attachment.file!.bytes!, + height: constraints?.maxHeight, + width: constraints?.maxWidth, + fit: BoxFit.cover, + errorBuilder: _imageErrorBuilder, ), - ), - ); + ); + } else if (attachment.localUri != null) { + return _buildImageAttachment( + context, + Image.asset( + attachment.localUri!.path, + height: constraints?.maxHeight, + width: constraints?.maxWidth, + fit: BoxFit.cover, + errorBuilder: _imageErrorBuilder, + ), + ); + } else { + return AttachmentError( + constraints: constraints, + ); + } }, network: () { var imageUrl = @@ -116,6 +127,12 @@ class StreamImageAttachment extends StreamAttachmentWidget { ); } + Widget _imageErrorBuilder(BuildContext _, Object __, StackTrace? ___) => + Image.asset( + 'images/placeholder.png', + package: 'stream_chat_flutter', + ); + Widget _buildImageAttachment(BuildContext context, Widget imageWidget) { return Container( constraints: constraints, diff --git a/packages/stream_chat_flutter/lib/src/attachment_actions_modal/attachment_actions_modal.dart b/packages/stream_chat_flutter/lib/src/attachment_actions_modal/attachment_actions_modal.dart index 510d2fe4..47a62a32 100644 --- a/packages/stream_chat_flutter/lib/src/attachment_actions_modal/attachment_actions_modal.dart +++ b/packages/stream_chat_flutter/lib/src/attachment_actions_modal/attachment_actions_modal.dart @@ -33,10 +33,10 @@ class AttachmentActionsModal extends StatelessWidget { /// Callback to download [attachment]. final AttachmentDownloader? attachmentDownloader; - /// Show reply option + /// Show "reply" option final bool showReply; - /// Show show in chat option + /// Show "show in chat" option final bool showShowInChat; /// Show save option @@ -55,6 +55,7 @@ class AttachmentActionsModal extends StatelessWidget { Attachment? attachment, Message? message, VoidCallback? onShowMessage, + VoidCallback? onReply, AttachmentDownloader? attachmentDownloader, bool? showReply, bool? showShowInChat, @@ -67,6 +68,7 @@ class AttachmentActionsModal extends StatelessWidget { attachment: attachment ?? this.attachment, message: message ?? this.message, onShowMessage: onShowMessage ?? this.onShowMessage, + onReply: onReply ?? this.onReply, attachmentDownloader: attachmentDownloader ?? this.attachmentDownloader, showReply: showReply ?? this.showReply, showShowInChat: showShowInChat ?? this.showShowInChat, @@ -112,7 +114,7 @@ class AttachmentActionsModal extends StatelessWidget { size: 24, color: theme.colorTheme.textLowEmphasis, ), - () => Navigator.of(context).pop(ReturnActionType.reply), + onReply, ), if (showShowInChat) _buildButton( diff --git a/packages/stream_chat_flutter/lib/src/fullscreen_media/fsm_enums.dart b/packages/stream_chat_flutter/lib/src/fullscreen_media/fsm_enums.dart index 5d2a1412..854682e1 100644 --- a/packages/stream_chat_flutter/lib/src/fullscreen_media/fsm_enums.dart +++ b/packages/stream_chat_flutter/lib/src/fullscreen_media/fsm_enums.dart @@ -1,4 +1,8 @@ +// TODO: remove in v6 as this is no longer used. Currently exported. + /// Return action for coming back from pages +@Deprecated(''' + ReturnActionType has been deprecated and is no longer used.''') enum ReturnActionType { /// No return action none, diff --git a/packages/stream_chat_flutter/pubspec.yaml b/packages/stream_chat_flutter/pubspec.yaml index 65bb686a..31ab0cb6 100644 --- a/packages/stream_chat_flutter/pubspec.yaml +++ b/packages/stream_chat_flutter/pubspec.yaml @@ -15,7 +15,7 @@ dependencies: collection: ^1.15.0 contextmenu: ^3.0.0 dart_vlc: ^0.3.0 - desktop_drop: ^0.3.3 + desktop_drop: ^0.4.0 diacritic: ^0.1.3 dio: ^4.0.6 ezanimation: ^0.6.0 @@ -31,7 +31,7 @@ dependencies: image_gallery_saver: ^1.7.0 image_picker: ^0.8.2 jiffy: ^5.0.0 - lottie: ^1.0.1 + lottie: ^2.0.0 meta: ^1.3.0 path_provider: ^2.0.9 photo_manager: ^2.0.1 diff --git a/packages/stream_chat_flutter_core/CHANGELOG.md b/packages/stream_chat_flutter_core/CHANGELOG.md index f5a993c5..2103798e 100644 --- a/packages/stream_chat_flutter_core/CHANGELOG.md +++ b/packages/stream_chat_flutter_core/CHANGELOG.md @@ -1,3 +1,9 @@ +## Upcomming + +🔄 Changed + +- Updated `connectivity_plus` dependency to `^3.0.2` + ## 5.1.0 - Deprecated the `sort` parameter in the `StreamChannelListController` in favor of `channelStateSort`. diff --git a/packages/stream_chat_flutter_core/pubspec.yaml b/packages/stream_chat_flutter_core/pubspec.yaml index afed786f..c3b4cffc 100644 --- a/packages/stream_chat_flutter_core/pubspec.yaml +++ b/packages/stream_chat_flutter_core/pubspec.yaml @@ -11,7 +11,7 @@ environment: dependencies: collection: ^1.15.0 - connectivity_plus: ^2.1.0 + connectivity_plus: ^3.0.2 flutter: sdk: flutter freezed_annotation: ^2.0.3