resetSystemUI static method

void resetSystemUI(
  1. BuildContext context
)

🔹 Reset system UI to match platform (system) theme.

  • Uses MediaQuery.of(context).platformBrightness to detect system theme (light/dark).
  • Useful for restoring after custom styles.
SystemUiUtils.resetSystemUI(context);

Implementation

static void resetSystemUI(BuildContext context) {
  final Brightness platformBrightness = MediaQuery.of(
    context,
  ).platformBrightness;

  final SystemUiOverlayStyle style = platformBrightness == Brightness.dark
      ? SystemUiOverlayStyle.light // white icons
      : SystemUiOverlayStyle.dark; // black icons

  SystemChrome.setSystemUIOverlayStyle(style);
}