From 5f59cb3a9d2f9d78c7c971b308a01a9e7007e08a Mon Sep 17 00:00:00 2001 From: Marcelo Amaro Date: Sun, 1 Dec 2024 23:42:11 -0300 Subject: [PATCH 1/4] chore: upgrade blip_ds version from sample --- sample/pubspec.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample/pubspec.lock b/sample/pubspec.lock index 6957204e..c3c4b0a5 100644 --- a/sample/pubspec.lock +++ b/sample/pubspec.lock @@ -31,7 +31,7 @@ packages: path: ".." relative: true source: path - version: "0.2.4" + version: "0.2.5" boolean_selector: dependency: transitive description: From c6b19a11ec0f7f37df600fd50df6f84a7eaaff31 Mon Sep 17 00:00:00 2001 From: Andre Rossi Date: Mon, 9 Dec 2024 12:40:18 -0300 Subject: [PATCH 2/4] feat: fix when thumbnail is unavailable --- .../ds_video_message_bubble.controller.dart | 23 +++++++++------- .../video/ds_video_message_bubble.widget.dart | 27 ++++++++++++------- 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/lib/src/controllers/chat/ds_video_message_bubble.controller.dart b/lib/src/controllers/chat/ds_video_message_bubble.controller.dart index d4306514..9a148b75 100644 --- a/lib/src/controllers/chat/ds_video_message_bubble.controller.dart +++ b/lib/src/controllers/chat/ds_video_message_bubble.controller.dart @@ -17,8 +17,14 @@ class DSVideoMessageBubbleController { final int mediaSize; final Map? httpHeaders; final String type; + final maximumProgress = RxInt(0); final downloadProgress = RxInt(0); + final isDownloading = RxBool(false); + final thumbnail = RxString(''); + final hasError = RxBool(false); + final isLoadingThumbnail = RxBool(false); + final isThumbnailUnavailable = RxBool(false); DSVideoMessageBubbleController({ required this.url, @@ -29,11 +35,6 @@ class DSVideoMessageBubbleController { getStoredVideo(); } - final isDownloading = RxBool(false); - final thumbnail = RxString(''); - final hasError = RxBool(false); - final isLoadingThumbnail = RxBool(false); - String size() { return mediaSize > 0 ? FileSize.getSize( @@ -127,10 +128,14 @@ class DSVideoMessageBubbleController { Future _generateThumbnail(String path) async { final thumbnailPath = await getFullThumbnailPath(); - await DSMediaFormatService.getVideoThumbnail( - input: path, - output: thumbnailPath, - ); + try { + await DSMediaFormatService.getVideoThumbnail( + input: path, + output: thumbnailPath, + ); + } catch (e) { + isThumbnailUnavailable.value = true; + } thumbnail.value = thumbnailPath; } diff --git a/lib/src/widgets/chat/video/ds_video_message_bubble.widget.dart b/lib/src/widgets/chat/video/ds_video_message_bubble.widget.dart index 33fba6c1..f6fdda3e 100644 --- a/lib/src/widgets/chat/video/ds_video_message_bubble.widget.dart +++ b/lib/src/widgets/chat/video/ds_video_message_bubble.widget.dart @@ -220,16 +220,23 @@ class _DSVideoMessageBubbleState extends State url: widget.url, shouldAuthenticate: widget.shouldAuthenticate, - thumbnail: Center( - child: Image.file( - File( - _controller.thumbnail.value, - ), - width: DSUtils.bubbleMinSize, - height: DSUtils.bubbleMinSize, - fit: BoxFit.cover, - ), - ), + thumbnail: _controller + .isThumbnailUnavailable + .value + ? const SizedBox.shrink() + : Center( + child: Image.file( + File( + _controller + .thumbnail.value, + ), + width: DSUtils + .bubbleMinSize, + height: DSUtils + .bubbleMinSize, + fit: BoxFit.cover, + ), + ), ), ) : _buidErrorIcon(), From 47e6dc240ee79a97951a2eda82e5193d8103d2b8 Mon Sep 17 00:00:00 2001 From: Andre Rossi Date: Mon, 9 Dec 2024 13:16:32 -0300 Subject: [PATCH 3/4] chore: upgrade version --- CHANGELOG.md | 4 ++++ pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee6c9b04..edeae1d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.2.6 + +- [DSVideoMessageBubble] Fix when thumbnail is unavailable. + ## 0.2.5 - [DSImageMessageBubble] Fix when channel is instagram. diff --git a/pubspec.yaml b/pubspec.yaml index dc10b2fa..13b56c6a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: blip_ds description: Blip Design System for Flutter. -version: 0.2.5 +version: 0.2.6 homepage: https://github.com/takenet/blip-ds-flutter#readme repository: https://github.com/takenet/blip-ds-flutter From eda0c3d2ca12d3f4cc0f688a83ab3d335a7671a0 Mon Sep 17 00:00:00 2001 From: Andre Rossi Date: Mon, 9 Dec 2024 13:47:07 -0300 Subject: [PATCH 4/4] refactor: remove unnecessary char --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index edeae1d4..f8c91d3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ ## 0.2.4 - [DSSecurityService] Add service to manage security features. -- + ## 0.2.3 - [DSPhoneInput] Add support to select current country code.