showEnvDebugPanel<E extends Enum> function

Future<void> showEnvDebugPanel<E extends Enum>(
  1. BuildContext context, {
  2. bool showRestartToggle = true,
  3. VoidCallback? onSwitched,
})

Shows the envify debug panel as a modal bottom sheet.

Lists all registered environments, highlights the active one, and lets the user tap to switch. An optional "restart after switch" toggle is shown when showRestartToggle is true.

onSwitched is called after the environment switch (and optional app restart) completes.

Implementation

Future<void> showEnvDebugPanel<E extends Enum>(
  BuildContext context, {
  bool showRestartToggle = true,
  VoidCallback? onSwitched,
}) {
  return showModalBottomSheet<void>(
    context: context,
    isScrollControlled: true,
    shape: const RoundedRectangleBorder(
      borderRadius: BorderRadius.vertical(top: Radius.circular(16)),
    ),
    builder: (_) => _EnvDebugPanel<E>(
      showRestartToggle: showRestartToggle,
      onSwitched: onSwitched,
    ),
  );
}