Seeing the following error on setSystemUIOverlayStyle.
Do I have to add some package to pubspec.yaml?
errors:
3
Try below code I think you write wrong code. for more refer this
this
void main() { SystemChrome.setSystemUIOverlayStyle( SystemUiOverlayStyle( statusBarColor: Colors.red,//change color on your need ), ); runApp(const MyApp()); }
Result screen->
You can set the StatusBar transparent by adding this in your main():
main()
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle( statusBarColor: Colors.transparent));
The problem is that you are putting it inside your runApp(). Your main() should look like this:
runApp()
void main() { SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle( statusBarColor: Colors.transparent)); runApp(const MyApp()); }
You can add this Into your initState() method. this is hide the bottom navigation as well.It is use for Full Screen design.
@override void initState() { super.initState();
SystemChrome.setEnabledSystemUIMode( SystemUiMode.manual, overlays: [], );}
Click here to cancel reply.
3
Answers
Try below code I think you write wrong code. for more refer
this
Result screen->
You can set the StatusBar transparent by adding this in your
main()
:The problem is that you are putting it inside your
runApp()
.Your
main()
should look like this:You can add this Into your initState() method. this is hide the bottom navigation as well.It is use for Full Screen design.
@override
void initState() {
super.initState();