resetSystemUI static method
🔹 Reset system UI to match platform (system) theme.
- Uses
MediaQuery.of(context).platformBrightnessto 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);
}