bugfix: make sure System UI is visible when navigating to filtered collection from Info
This commit is contained in:
parent
53dfe85e07
commit
7580988747
2 changed files with 44 additions and 26 deletions
|
@ -2,9 +2,11 @@ import 'dart:io';
|
|||
import 'dart:math';
|
||||
|
||||
import 'package:aves/model/collection_lens.dart';
|
||||
import 'package:aves/model/filters/filters.dart';
|
||||
import 'package:aves/model/image_entry.dart';
|
||||
import 'package:aves/utils/change_notifier.dart';
|
||||
import 'package:aves/utils/constants.dart';
|
||||
import 'package:aves/widgets/album/collection_page.dart';
|
||||
import 'package:aves/widgets/common/image_providers/thumbnail_provider.dart';
|
||||
import 'package:aves/widgets/common/image_providers/uri_image_provider.dart';
|
||||
import 'package:aves/widgets/fullscreen/fullscreen_action_delegate.dart';
|
||||
|
@ -207,22 +209,28 @@ class FullscreenBodyState extends State<FullscreenBody> with SingleTickerProvide
|
|||
_onLeave();
|
||||
return SynchronousFuture(true);
|
||||
},
|
||||
child: Stack(
|
||||
children: [
|
||||
FullscreenVerticalPageView(
|
||||
collection: collection,
|
||||
entry: _entry,
|
||||
videoControllers: _videoControllers,
|
||||
verticalPager: _verticalPager,
|
||||
horizontalPager: _horizontalPager,
|
||||
onVerticalPageChanged: _onVerticalPageChanged,
|
||||
onHorizontalPageChanged: _onHorizontalPageChanged,
|
||||
onImageTap: () => _overlayVisible.value = !_overlayVisible.value,
|
||||
onImagePageRequested: () => _goToVerticalPage(imagePage),
|
||||
),
|
||||
topOverlay,
|
||||
bottomOverlay,
|
||||
],
|
||||
child: NotificationListener(
|
||||
onNotification: (notification) {
|
||||
if (notification is FilterNotification) _goToCollection(notification.filter);
|
||||
return false;
|
||||
},
|
||||
child: Stack(
|
||||
children: [
|
||||
FullscreenVerticalPageView(
|
||||
collection: collection,
|
||||
entry: _entry,
|
||||
videoControllers: _videoControllers,
|
||||
verticalPager: _verticalPager,
|
||||
horizontalPager: _horizontalPager,
|
||||
onVerticalPageChanged: _onVerticalPageChanged,
|
||||
onHorizontalPageChanged: _onHorizontalPageChanged,
|
||||
onImageTap: () => _overlayVisible.value = !_overlayVisible.value,
|
||||
onImagePageRequested: () => _goToVerticalPage(imagePage),
|
||||
),
|
||||
topOverlay,
|
||||
bottomOverlay,
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -231,6 +239,17 @@ class FullscreenBodyState extends State<FullscreenBody> with SingleTickerProvide
|
|||
_verticalScrollNotifier.notifyListeners();
|
||||
}
|
||||
|
||||
void _goToCollection(CollectionFilter filter) {
|
||||
_showSystemUI();
|
||||
Navigator.pushAndRemoveUntil(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => CollectionPage(collection.derive(filter)),
|
||||
),
|
||||
(route) => false,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _goToVerticalPage(int page) {
|
||||
return _verticalPager.animateToPage(
|
||||
page,
|
||||
|
@ -275,9 +294,9 @@ class FullscreenBodyState extends State<FullscreenBody> with SingleTickerProvide
|
|||
|
||||
// system UI
|
||||
|
||||
void _showSystemUI() => SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);
|
||||
static void _showSystemUI() => SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);
|
||||
|
||||
void _hideSystemUI() => SystemChrome.setEnabledSystemUIOverlays([]);
|
||||
static void _hideSystemUI() => SystemChrome.setEnabledSystemUIOverlays([]);
|
||||
|
||||
// overlay
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import 'package:aves/model/collection_lens.dart';
|
||||
import 'package:aves/model/filters/filters.dart';
|
||||
import 'package:aves/model/image_entry.dart';
|
||||
import 'package:aves/widgets/album/collection_page.dart';
|
||||
import 'package:aves/widgets/common/aves_filter_chip.dart';
|
||||
import 'package:aves/widgets/common/data_providers/media_query_data_provider.dart';
|
||||
import 'package:aves/widgets/fullscreen/info/basic_section.dart';
|
||||
|
@ -155,13 +154,7 @@ class InfoPageState extends State<InfoPage> {
|
|||
|
||||
void _goToCollection(CollectionFilter filter) {
|
||||
if (collection == null) return;
|
||||
Navigator.pushAndRemoveUntil(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => CollectionPage(collection.derive(filter)),
|
||||
),
|
||||
(route) => false,
|
||||
);
|
||||
FilterNotification(filter).dispatch(context);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -228,3 +221,9 @@ class InfoRowGroup extends StatelessWidget {
|
|||
}
|
||||
|
||||
class BackUpNotification extends Notification {}
|
||||
|
||||
class FilterNotification extends Notification {
|
||||
final CollectionFilter filter;
|
||||
|
||||
const FilterNotification(this.filter);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue