mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-08 23:18:16 -07:00
Fix for empty queryParameters
This commit is contained in:
parent
249bd685b1
commit
69b3a77d17
1 changed files with 9 additions and 2 deletions
|
|
@ -92,8 +92,7 @@ class NestedNavigationDrawer extends ConsumerWidget {
|
||||||
),
|
),
|
||||||
...views.map((library) => DrawerListButton(
|
...views.map((library) => DrawerListButton(
|
||||||
label: library.name,
|
label: library.name,
|
||||||
selected: context.router.current.name == LibrarySearchRoute().routeName &&
|
selected: checkLibrary(context, library.id),
|
||||||
context.routeData.queryParams.getString('parentId') == library.id,
|
|
||||||
actions: [
|
actions: [
|
||||||
ItemActionButton(
|
ItemActionButton(
|
||||||
label: Text(context.localized.scanLibrary),
|
label: Text(context.localized.scanLibrary),
|
||||||
|
|
@ -152,4 +151,12 @@ class NestedNavigationDrawer extends ConsumerWidget {
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool checkLibrary(BuildContext context, String id) {
|
||||||
|
try {
|
||||||
|
return context.routeData.queryParams.isNotEmpty && context.routeData.queryParams.getString('parentId') == id;
|
||||||
|
} catch (e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue