From 730c8bd63282d084829a86caf5bb0ad0fb04fc65 Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Mon, 16 Mar 2020 16:55:13 +0900 Subject: [PATCH] viewer: catalog/locate on launch --- lib/main.dart | 3 +++ lib/widgets/fullscreen/overlay/bottom.dart | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 4824b1dbb..6d952ad9a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -85,6 +85,9 @@ class _HomePageState extends State { final sharedExtra = await ViewerService.getSharedEntry(); if (sharedExtra != null) { _sharedEntry = await ImageFileService.getImageEntry(sharedExtra['uri'], sharedExtra['mimeType']); + // cataloging is essential for geolocation and video rotation + await _sharedEntry.catalog(); + unawaited(_sharedEntry.locate()); } } diff --git a/lib/widgets/fullscreen/overlay/bottom.dart b/lib/widgets/fullscreen/overlay/bottom.dart index fd2c255e4..78e8dd6fe 100644 --- a/lib/widgets/fullscreen/overlay/bottom.dart +++ b/lib/widgets/fullscreen/overlay/bottom.dart @@ -157,7 +157,7 @@ class _FullscreenBottomOverlayContent extends StatelessWidget { Container( padding: const EdgeInsets.only(top: _interRowPadding), width: subRowWidth, - child: _LocationRow(entry), + child: _LocationRow(entry: entry), ), if (twoColumns) Padding( @@ -190,10 +190,13 @@ class _FullscreenBottomOverlayContent extends StatelessWidget { } } -class _LocationRow extends StatelessWidget { +class _LocationRow extends AnimatedWidget { final ImageEntry entry; - const _LocationRow(this.entry); + _LocationRow({ + Key key, + this.entry, + }) : super(key: key, listenable: entry.addressChangeNotifier); @override Widget build(BuildContext context) {