fullscreen: always locate entry

This commit is contained in:
Thibault Deckers 2020-07-05 10:11:41 +09:00
parent ff58d89163
commit 7f62846539
2 changed files with 4 additions and 31 deletions

View file

@ -514,6 +514,10 @@ class _FullscreenVerticalPageViewState extends State<FullscreenVerticalPageView>
_oldEntry?.imageChangeNotifier?.removeListener(_onImageChanged);
entry?.imageChangeNotifier?.addListener(_onImageChanged);
_oldEntry = entry;
// make sure to locate the entry,
// so that we can display the address instead of coordinates
// even when background locating has not reached this entry yet
entry?.locate();
}
// when the entry image itself changed (e.g. after rotation)

View file

@ -34,33 +34,6 @@ class InfoPageState extends State<InfoPage> {
CollectionLens get collection => widget.collection;
@override
void initState() {
super.initState();
_registerWidget(widget);
}
@override
void didUpdateWidget(InfoPage oldWidget) {
super.didUpdateWidget(oldWidget);
_unregisterWidget(oldWidget);
_registerWidget(widget);
}
@override
void dispose() {
_unregisterWidget(widget);
super.dispose();
}
void _registerWidget(InfoPage widget) {
widget.entryNotifier.addListener(_onEntryChanged);
}
void _unregisterWidget(InfoPage widget) {
widget.entryNotifier.removeListener(_onEntryChanged);
}
@override
Widget build(BuildContext context) {
const horizontalPadding = EdgeInsets.symmetric(horizontal: 8);
@ -147,10 +120,6 @@ class InfoPageState extends State<InfoPage> {
);
}
void _onEntryChanged() {
widget.entryNotifier.value?.locate();
}
bool _handleTopScroll(Notification notification) {
if (notification is ScrollNotification) {
if (notification is ScrollStartNotification) {