When I try to set status bar color using library (flutter_statusbarcolor_ns) or directly using direct flutter code:
void _setStatusBarColor(Color color) {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarColor: color,
));
}
Status bar color is not getting set properly. It is working in ipad portrait mode perfectly but cutting in nearly half (or 60%) in ipad landscape mode.
Note: I tried many things including different libraries, checking flutter native codes, but no luck. Any help is appreciated.
2
Answers
Rendering in flutter isn’t subject to system calls or components, so 1 such solution may involve manually rendering the color you want and using the systemchrome setting simply for the brightness (should icons be white or black)
Something like this would allow you to have a "SafeArea" widget that you would naturally use elsewhere to handle changing the status bar, you could even do custom implementations of appbar to handle no using the safearea so you can custom fill it, but as you can see this works in an ipad simulator
The simplest solution you can have is Wrapping your
MaterialApp
in themain.dart
with theColoredBox
widget, and giving a Color.