From 9bf9a6f23b64cbe7523149e32e0229fb4902ac31 Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Thu, 19 Feb 2026 00:39:44 +0100 Subject: [PATCH] fix: clear stale back-key flags on overlay sheet close --- lib/widgets/overlay_sheet.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/widgets/overlay_sheet.dart b/lib/widgets/overlay_sheet.dart index 0d5c7318..edaeae38 100644 --- a/lib/widgets/overlay_sheet.dart +++ b/lib/widgets/overlay_sheet.dart @@ -244,6 +244,12 @@ class _OverlaySheetHostState extends State with SingleTickerPr _dragOffset = 0; _isDragging = false; }); + // Clear stale back-key flags. handleBackKeyAction sets + // markClosedViaBackKey() expecting a route pop, but the overlay + // doesn't pop a route. Without clearing, the flag leaks into the + // next real route pop and disables KeyUp suppression, causing a + // double-pop on the underlying screen. + BackKeyUpSuppressor.clearSuppression(); }); }