pushDebugSettingsRoute method
Pushes the debug settings screen, at most one at a time.
The same link can reach here more than once: as a route push and through
consumePendingDebugSettingsRequest whenever the host leaves Flutter's own
deeplink forwarding on, plus a third time from Digia.openDebugSettings if
the host still routes the link itself (an app_links listener, say). The
guard is set before the first await, so later arrivals find the screen
already claimed instead of stacking a duplicate route on top of it.
Implementation
Future<void> pushDebugSettingsRoute(NavigatorState navigator) async {
if (_debugSettingsRouteOpen) return;
_debugSettingsRouteOpen = true;
captureBubbleHiddenNotifier.value = true;
try {
await navigator.push(
MaterialPageRoute<void>(
builder: (_) => const DigiaDebugSettingsScreen(),
),
);
} finally {
_debugSettingsRouteOpen = false;
captureBubbleHiddenNotifier.value = false;
}
}