mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08: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(
|
||||
label: library.name,
|
||||
selected: context.router.current.name == LibrarySearchRoute().routeName &&
|
||||
context.routeData.queryParams.getString('parentId') == library.id,
|
||||
selected: checkLibrary(context, library.id),
|
||||
actions: [
|
||||
ItemActionButton(
|
||||
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