fixed searching from drawer on mobile

This commit is contained in:
Thibault Deckers 2024-01-12 20:01:38 +01:00
parent fe8415fced
commit 426264d186
3 changed files with 9 additions and 4 deletions

View file

@ -15,6 +15,11 @@ All notable changes to this project will be documented in this file.
- Slideshow: keep playing when losing focus but app is still visible (e.g. split screen)
- upgraded Flutter to stable v3.16.7
### Fixed
- crash when loading some large DNG in viewer
- searching from drawer on mobile
## <a id="v1.10.2"></a>[v1.10.2] - 2023-12-24
### Changed

View file

@ -50,7 +50,7 @@ class PageNavTile extends StatelessWidget {
: null,
onTap: () {
Navigator.maybeOf(context)?.pop();
final route = routeBuilder(context, routeName);
final route = routeBuilder(context, routeName, topLevel);
if (topLevel) {
Navigator.maybeOf(context)?.pushAndRemoveUntil(
route,
@ -65,7 +65,7 @@ class PageNavTile extends StatelessWidget {
);
}
static Route routeBuilder(BuildContext context, String routeName) {
static Route routeBuilder(BuildContext context, String routeName, bool topLevel) {
switch (routeName) {
case SearchPage.routeName:
final currentCollection = context.read<CollectionLens?>();
@ -74,7 +74,7 @@ class PageNavTile extends StatelessWidget {
searchFieldLabel: context.l10n.searchCollectionFieldHint,
searchFieldStyle: Themes.searchFieldStyle(context),
source: context.read<CollectionSource>(),
parentCollection: currentCollection?.copyWith(),
parentCollection: topLevel ? currentCollection?.copyWith() : currentCollection,
),
);
default:

View file

@ -253,7 +253,7 @@ class _TvRailState extends State<TvRail> {
void _goTo(String routeName) {
Navigator.maybeOf(context)?.pushAndRemoveUntil(
PageNavTile.routeBuilder(context, routeName),
PageNavTile.routeBuilder(context, routeName, true),
(route) => false,
);
}