I was using the following code to show only status bar.
SystemChrome.setEnabledSystemUIOverlays([
SystemUiOverlay.top
])
but it started giving me a warning:
setEnabledSystemUIOverlays is deprecated and shouldn't be used. Migrate to setEnabledSystemUIMode.
So, how do I fix it?
Use setEnabledSystemUIMode
and provide SystemUiMode.manual
as shown below:
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: [
SystemUiOverlay.top
]);
You can also use SystemUiMode
Hide both overlays:
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
Show both overlays:
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
Use setEnabledSystemUIMode instead of setEnabledSystemUIOverlays. Example:
SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom, SystemUiOverlay.top]);
change it to:
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: [SystemUiOverlay.bottom, SystemUiOverlay.top]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With