viewer: catalog/locate on launch

This commit is contained in:
Thibault Deckers 2020-03-16 16:55:13 +09:00
parent ad04967464
commit 730c8bd632
2 changed files with 9 additions and 3 deletions

View file

@ -85,6 +85,9 @@ class _HomePageState extends State<HomePage> {
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());
}
}

View file

@ -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) {