fix(settings): dismiss Manage Libraries without leaving Settings
On phone layouts main_screen pushes SettingsScreen as its own route, and that route carried no OverlaySheetHost. showAdaptive could not find one from the tile's context, so Manage Libraries fell back to showModalBottomSheet. The sheet also owns a focused Back handler, so a single Android Back arrived twice — once as a key event, once as popRoute — and the two route-based paths raced, tearing down Settings along with the sheet. Installs one route-local host when no enclosing host exists, and opens the sheet from a context below it. OverlaySheetHost then holds the route while a sheet is open and deduplicates the key path, so one Back closes only the sheet.
This commit is contained in:
@@ -87,10 +87,9 @@ Future<void> showLibraryManagementSheet(
|
||||
if (PlatformDetector.isTV()) {
|
||||
return showScopedDialog<void>(context: context, builder: (context) => buildSheet(isDialog: true));
|
||||
}
|
||||
// showAdaptive rather than of(context).show: on mobile, settings is a pushed
|
||||
// route outside the OverlaySheetHost subtree, so only the fallback path is
|
||||
// available there. isScrollControlled keeps the fallback modal from capping
|
||||
// the sheet at ~9/16 of the screen.
|
||||
// Use the host supplied by the calling screen when available while keeping
|
||||
// this reusable entry point safe for routes without one. isScrollControlled
|
||||
// keeps that modal fallback from capping the sheet at ~9/16 of the screen.
|
||||
return OverlaySheetController.showAdaptive<void>(
|
||||
context,
|
||||
showDragHandle: true,
|
||||
|
||||
Reference in New Issue
Block a user