1

I tried removing the status bar on my app and the solution I found included:

SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);

but the Problem is when I set this either in the main() or in init() of my page, both ways I see a black status bar.

I have tried the following:

  • setting the status bar to transparent
  • setting the status bar to white
  • instead of immersiveSticky, immersive and leanBack
  • changing status bar brightness and status bar icon brightness

But I face the same problem which is that if there is a notification with a black icon, It is clearly visible on the invisible status bar

I found the problem but I dont know how to fix it. On vivo, apps can decide to show the camera or hide it with a black strip(in my case), but I had to manually change the setting from Automatic Fitting (let app decide) to Show the camera I want the app to do this automatically

Example:

class Example extends StatefulWidget {
 const Example({super.key});
 @override
 State<Example> createState() => _ExampleState();
}
class _ExampleState extends State<Example> {
@override
 void initState() {
 SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
 super.initState();
 }
@override
 Widget build(BuildContext context) {
return Container();
}
}
asked Oct 12, 2024 at 9:40

1 Answer 1

0

Add in 'android/app/src/main/res/values/styles.xml'

<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>

It's worked for me.

answered Nov 2, 2024 at 10:40
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.