1

I am developing on flutter based hybrid mobile app on which I am using Google Pixel XL API 28 emulator. The application works fine but my title on the application is cut due to notch of the screen. I have tried to add a safe area too but could not get success. Anyone have any idea of this. Thanks in advance.

Image:

enter image description here

Vrushi Patel
  • 2,361
  • 1
  • 17
  • 30
Hardik1344
  • 2,917
  • 2
  • 15
  • 31

3 Answers3

2

Finally!! I found the solutions.

Create one folder inside Android res's folder with the name of "values-v28" Copy the code from Values folder's styles.xml file and paste it into new folder or replace the below code inside the new folder's styles.xml file. Force quit terminal which you used.

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
        <!-- Show a splash screen on the activity. Automatically removed when
             Flutter draws its first frame -->
        <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
    </style>
</resources>

It works for me. thanks for your valuable respose.

Hardik1344
  • 2,917
  • 2
  • 15
  • 31
1

You can use "SafeArea" Like Below Code:-

return Scaffold(
      body: SafeArea(
          child: Container()),
);
Dhaval Patel
  • 369
  • 1
  • 8
1

you can put Scaffold into safe area

 return SafeArea(    
 child: Scaffold  ( ),
 );
nordine enn
  • 78
  • 1
  • 8