In Related question, app can hide the status bar with
SystemChrome.setEnabledSystemUIOverlays([]);
But if I surround that with a media query to detect orientation in the main app, it causes the app to error because there is no material ancestor widget.
// app error
if (MediaQuery.of(context).orientation == Orientation.landscape) {
SystemChrome.setEnabledSystemUIOverlays([]);
}
Is there a way to conditionally hide the status bar in Flutter for the entire app, if the device rotates to landscape mode?