From 7cafa9ccb686436dc4f62a006ce7fb253ce119c4 Mon Sep 17 00:00:00 2001 From: Prateek Sunal Date: Thu, 8 Aug 2024 04:00:59 +0530 Subject: [PATCH] fix(mob/panorama): add background pattern --- .../lib/ui/viewer/file/file_bottom_bar.dart | 7 +- .../viewer/file/panorama_viewer_screen.dart | 5 ++ mobile/pubspec.lock | 71 +++++++++++-------- mobile/pubspec.yaml | 9 ++- 4 files changed, 57 insertions(+), 35 deletions(-) diff --git a/mobile/lib/ui/viewer/file/file_bottom_bar.dart b/mobile/lib/ui/viewer/file/file_bottom_bar.dart index 9d9b00ebb6..9b60748386 100644 --- a/mobile/lib/ui/viewer/file/file_bottom_bar.dart +++ b/mobile/lib/ui/viewer/file/file_bottom_bar.dart @@ -22,6 +22,7 @@ import 'package:photos/utils/delete_file_util.dart'; import "package:photos/utils/file_util.dart"; import "package:photos/utils/panorama_util.dart"; import 'package:photos/utils/share_util.dart'; +import "package:photos/utils/thumbnail_util.dart"; class FileBottomBar extends StatefulWidget { final EnteFile file; @@ -296,10 +297,14 @@ class FileBottomBarState extends State { if (fetchedFile == null) { return; } + final fetchedThumbnail = await getThumbnail(file); Navigator.of(context).push( MaterialPageRoute( builder: (_) { - return PanoramaViewerScreen(file: fetchedFile); + return PanoramaViewerScreen( + file: fetchedFile, + thumbnail: fetchedThumbnail, + ); }, ), ).ignore(); diff --git a/mobile/lib/ui/viewer/file/panorama_viewer_screen.dart b/mobile/lib/ui/viewer/file/panorama_viewer_screen.dart index 4b05bbd6f9..b54b63879c 100644 --- a/mobile/lib/ui/viewer/file/panorama_viewer_screen.dart +++ b/mobile/lib/ui/viewer/file/panorama_viewer_screen.dart @@ -11,9 +11,11 @@ class PanoramaViewerScreen extends StatefulWidget { const PanoramaViewerScreen({ super.key, required this.file, + required this.thumbnail, }); final File file; + final Uint8List? thumbnail; @override State createState() => _PanoramaViewerScreenState(); @@ -139,6 +141,9 @@ class _PanoramaViewerScreenState extends State { croppedFullWidth: width, croppedFullHeight: height, sensorControl: control, + background: widget.thumbnail != null + ? Image.memory(widget.thumbnail!) + : null, child: Image.file( widget.file, ), diff --git a/mobile/pubspec.lock b/mobile/pubspec.lock index ca98122697..e9cec130c2 100644 --- a/mobile/pubspec.lock +++ b/mobile/pubspec.lock @@ -69,10 +69,10 @@ packages: dependency: "direct main" description: name: archive - sha256: "22600aa1e926be775fa5fe7e6894e7fb3df9efda8891c73f70fb3262399a432d" + sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d url: "https://pub.dev" source: hosted - version: "3.4.10" + version: "3.6.1" args: dependency: transitive description: @@ -113,6 +113,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.6" + blurhash_ffi: + dependency: transitive + description: + name: blurhash_ffi + sha256: "941868602bb3bc34b0a7d630e4bf0e88e4c93af36090fe1cc0d63021c9a46cb3" + url: "https://pub.dev" + source: hosted + version: "1.2.6" boolean_selector: dependency: transitive description: @@ -799,10 +807,10 @@ packages: dependency: "direct main" description: name: flutter_local_notifications - sha256: f9a05409385b77b06c18f200a41c7c2711ebf7415669350bb0f8474c07bd40d1 + sha256: dd6676d8c2926537eccdf9f72128bbb2a9d0814689527b17f92c248ff192eaf3 url: "https://pub.dev" source: hosted - version: "17.0.0" + version: "17.2.1+2" flutter_local_notifications_linux: dependency: transitive description: @@ -815,10 +823,10 @@ packages: dependency: transitive description: name: flutter_local_notifications_platform_interface - sha256: "7cf643d6d5022f3baed0be777b0662cce5919c0a7b86e700299f22dc4ae660ef" + sha256: "85f8d07fe708c1bdcf45037f2c0109753b26ae077e9d9e899d55971711a4ea66" url: "https://pub.dev" source: hosted - version: "7.0.0+1" + version: "7.2.0" flutter_localizations: dependency: "direct main" description: flutter @@ -1304,18 +1312,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" url: "https://pub.dev" source: hosted - version: "10.0.4" + version: "10.0.5" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.5" leak_tracker_testing: dependency: transitive description: @@ -1440,10 +1448,10 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.11.1" media_extension: dependency: "direct main" description: @@ -1528,10 +1536,10 @@ packages: dependency: transitive description: name: meta - sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.15.0" mgrs_dart: dependency: transitive description: @@ -1682,10 +1690,11 @@ packages: panorama_viewer: dependency: "direct main" description: - name: panorama_viewer - sha256: "66b51a28921df33463968ebb411394551f6dbb065cc98474401820d6c2676e57" - url: "https://pub.dev" - source: hosted + path: "." + ref: HEAD + resolved-ref: "26ad55b2aa29dde14d640d6f1e17ce132a87910a" + url: "https://github.com/prateekmedia/panorama_viewer.git" + source: git version: "1.0.5" password_strength: dependency: "direct main" @@ -1867,10 +1876,10 @@ packages: dependency: transitive description: name: platform - sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec" + sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" url: "https://pub.dev" source: hosted - version: "3.1.4" + version: "3.1.5" plugin_platform_interface: dependency: transitive description: @@ -2376,26 +2385,26 @@ packages: dependency: "direct dev" description: name: test - sha256: "7ee446762c2c50b3bd4ea96fe13ffac69919352bd3b4b17bac3f3465edc58073" + sha256: "7ee44229615f8f642b68120165ae4c2a75fe77ae2065b1e55ae4711f6cf0899e" url: "https://pub.dev" source: hosted - version: "1.25.2" + version: "1.25.7" test_api: dependency: transitive description: name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.7.0" + version: "0.7.2" test_core: dependency: transitive description: name: test_core - sha256: "2bc4b4ecddd75309300d8096f781c0e3280ca1ef85beda558d33fcbedc2eead4" + sha256: "55ea5a652e38a1dfb32943a7973f3681a60f872f8c3a05a14664ad54ef9c6696" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.4" timezone: dependency: transitive description: @@ -2674,10 +2683,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc url: "https://pub.dev" source: hosted - version: "14.2.1" + version: "14.2.4" volume_controller: dependency: transitive description: @@ -2767,13 +2776,13 @@ packages: source: hosted version: "0.0.2" win32: - dependency: transitive + dependency: "direct overridden" description: name: win32 - sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8" + sha256: "015002c060f1ae9f41a818f2d5640389cc05283e368be19dc8d77cecb43c40c9" url: "https://pub.dev" source: hosted - version: "5.2.0" + version: "5.5.3" win32_registry: dependency: transitive description: diff --git a/mobile/pubspec.yaml b/mobile/pubspec.yaml index a03ba4143a..e090092713 100644 --- a/mobile/pubspec.yaml +++ b/mobile/pubspec.yaml @@ -22,7 +22,7 @@ dependencies: adaptive_theme: ^3.1.0 animate_do: ^2.0.0 animated_list_plus: ^0.5.2 - archive: ^3.1.2 + archive: ^3.6.1 background_fetch: ^1.2.1 battery_info: ^1.1.1 bip39: ^1.0.6 @@ -81,7 +81,7 @@ dependencies: flutter_image_compress: ^1.1.0 flutter_inappwebview: ^5.8.0 flutter_launcher_icons: ^0.13.1 - flutter_local_notifications: ^17.0.0 + flutter_local_notifications: ^17.2.1+2 flutter_localizations: sdk: flutter flutter_map: ^6.2.0 @@ -131,7 +131,9 @@ dependencies: open_mail_app: ^0.4.5 package_info_plus: ^4.1.0 page_transition: ^2.0.2 - panorama_viewer: ^1.0.5 + panorama_viewer: + git: + url: https://github.com/ente-io/panorama_viewer.git password_strength: ^0.2.0 path: #dart path_provider: ^2.1.1 @@ -195,6 +197,7 @@ dependency_overrides: ref: android_video_roation_fix path: packages/video_player/video_player/ watcher: ^1.1.0 + win32: ^5.5.3 flutter_intl: enabled: true