Flutter Change color Notches

Viewed 173

I have a question.

Is it possible to change the color of the phone notch? how is it framed in red

And detect the oval edge of the screen? All this in Flutter

enter image description here

2 Answers

I am guessing you wish to change the color of the status bar? If so you can add this code snippet in your initState function.

  void initState() 
  {
    SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
      statusBarColor: Colors.white,
      statusBarBrightness: Brightness.light,
      statusBarIconBrightness: Brightness.dark, 
    ));
    super.initState();
  }

The statusBarColor will be the actual color of the background of your status bar. The other two attributes change how the icons of the status bar look.

To detect the oval edge and make sure content isn’t on it where you can’t see it, wrap your Scaffold in a SafeArea.

Related