Home > Blockchain >  How to prevent widgets from placing themselves under notifications bar / camera?
How to prevent widgets from placing themselves under notifications bar / camera?

Time:12-01

In all my apps, I get the problem of having my widgets place themselves under the camera/notification bar.

I usually just place a sizedbox at the top to prevent it but it feels like a bad solution.

Is there any other way to prevent it?

Simple text widget gets placed under camera

CodePudding user response:

To fix your issue you have to wrap your widget inside a SafeArea

SafeArea(
  child: MyWidget(),
)

CodePudding user response:

To fix this issue you have to put your widget inside SafeArea

If you want to use SafeArea in only top and bottom directions, then you can specify in following way.

SafeArea( 
    left: false, 
    top: true, 
    bottom: true, 
    right: false, 
    child: Text('Your Widget'), 
  ) 
  • Related