Repository navigation
[Android]Switching between immersive and edgeToEdge system UI modes shows black status bar #95403
Description
Activity
- changed the title
[-]Switching between immersive and edge to edge system UI modes causes unexpected behavior[/-][+]Switching between immersive and edgeToEdge system UI modes causes unexpected behavior[/+]on Dec 16, 2021 - addedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Dec 17, 2021 HI @rasitayaz, Thanks for filing the issue. I am not able to reproduce the issue on Xiaomi k20 pro (Android 11), neither on stable 2.8.0 nor on master 2.9 . It looks like this issue is device-specific.
Screen.Recording.2021-12-17.at.2.16.59.PM.mov
flutter doctor -v
[✓] Flutter (Channel stable, 2.8.0, on macOS 12.1 21C52 darwin-arm, locale en-GB) • Flutter version 2.8.0 at /Users/mahesh/Documents/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision cf44000065 (8 days ago), 2021-12-08 14:06:50 -0800 • Engine revision 40a99c5951 • Dart version 2.15.0 [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) • Android SDK at /Users/mahesh/Library/Android/sdk • Platform android-31, build-tools 31.0.0 • ANDROID_HOME = /Users/mahesh/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 13.1) • Xcode at /Applications/Xcode.app/Contents/Developer • CocoaPods version 1.10.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 4.2) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264) [✓] IntelliJ IDEA Community Edition (version 2021.2.1) • IntelliJ at /Applications/IntelliJ IDEA CE.app • Flutter plugin version 60.1.4 • Dart plugin version 212.5080.8 [✓] VS Code (version 1.61.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.29.0 [✓] Connected device (3 available) • Redmi K20 Pro (mobile) • 192.168.1.4:5555 • android-arm64 • Android 11 (API 30) • macOS (desktop) • macos • darwin-arm64 • macOS 12.1 21C52 darwin-arm • Chrome (web) • chrome • web-javascript • Google Chrome 96.0.4664.110 • No issues found![✓] Flutter (Channel master, 2.9.0-1.0.pre.93, on macOS 12.1 21C52 darwin-arm, locale en-GB) • Flutter version 2.9.0-1.0.pre.93 at /Users/mahesh/Documents/flutter_master • Upstream repository https://github.com/flutter/flutter.git • Framework revision 1be7f1ea56 (2 days ago), 2021-12-14 22:14:07 -0500 • Engine revision e444009bf4 • Dart version 2.16.0 (build 2.16.0-109.0.dev) • DevTools version 2.9.1 [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) • Android SDK at /Users/mahesh/Library/Android/sdk • Platform android-31, build-tools 31.0.0 • ANDROID_HOME = /Users/mahesh/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 13.1) • Xcode at /Applications/Xcode.app/Contents/Developer • CocoaPods version 1.10.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 4.2) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264) [✓] IntelliJ IDEA Community Edition (version 2021.2.1) • IntelliJ at /Applications/IntelliJ IDEA CE.app • Flutter plugin version 60.1.4 • Dart plugin version 212.5080.8 [✓] VS Code (version 1.61.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.29.0 [✓] Connected device (3 available) • Redmi K20 Pro (mobile) • 192.168.1.4:5555 • android-arm64 • Android 11 (API 30) • macOS (desktop) • macos • darwin-arm64 • macOS 12.1 21C52 darwin-arm • Chrome (web) • chrome • web-javascript • Google Chrome 96.0.4664.110 • No issues found!Reacted by tisign- addedframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.platform-androidAndroid applications specificallyAndroid applications specificallyc: renderingUI glitches reported at the engine/skia or impeller rendering levelUI glitches reported at the engine/skia or impeller rendering levele: device-specificOnly manifests on certain devicesOnly manifests on certain devicesand removedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Dec 17, 2021 Thanks for the response @maheshmnj, is there any other way that I can hide the status and the navigation bars on
edgeToEdgewithout switching to theimmersivemode?Thanks for the response @maheshmnj, is there any other way that I can hide the status and the navigation bars on edgeToEdge without switching to the immersive mode?
I am not really aware of any other way.
this issue happens on some phones like mine (A21s) or in emulators I think pixel_4 has the same issue, the status bar will become blank-black and I didn't find any solution for this issue
Reacted by Raşit Ayaz, Max Zimmermann and Naiara BedinWell, I only set
SystemUiMode.edgeToEdge, but Mi8 (Android 9) appears in immersive mode on launch (with black status bar as well)
This happened after updating flutter 2.5.0 -> 2.8.0
The issue here is having immersive mode while I didn't request itOther devices are unaffected
Reacted by Raşit Ayaz, Jonathan Cole and zilanfengOther devices are unaffected
Oh, I've just reproduced this on pixel 3 emulator (api 28)
if I remove a call to
PlatformPlugin.updateSystemUiOverlays()everything becomes fine (debugging shows only default flags are used)13 remaining items
If someone still have the "black status bar" issue, adding this code in my
MainActivity.ktfixed the issue :)window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGESFull Code :
import io.flutter.embedding.android.FlutterActivity import android.os.Bundle import android.view.WindowManager class MainActivity : FlutterActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES } }Reacted by keybow@minpro, Happy Makadiya, LuneFlu, fondoger, Qz, Luis., Stanislav Drakin, yxzwym, Viktor Naustinnyi and lemteayReacted by Qz, Luis., Stanislav Drakin, diudiu and yxzwymIf someone still have the "black status bar" issue, adding this code in my
MainActivity.ktfixed the issue :)window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGESFull Code :
import io.flutter.embedding.android.FlutterActivity import android.os.Bundle import android.view.WindowManager class MainActivity : FlutterActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES } }This worked for me. I was very distressed and it helped! Thank you so much!
If someone still have the "black status bar" issue, adding this code in my
MainActivity.ktfixed the issue :)window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGESFull Code :
import io.flutter.embedding.android.FlutterActivity import android.os.Bundle import android.view.WindowManager class MainActivity : FlutterActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES } }Worked for me too. This should be implemented as flutter's default behavior since it is edge to edge by default.
If someone still have the "black status bar" issue, adding this code in my
MainActivity.ktfixed the issue :)window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGESFull Code :
import io.flutter.embedding.android.FlutterActivity import android.os.Bundle import android.view.WindowManager class MainActivity : FlutterActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES } }It works. Thanks !
Если у кого-то все еще есть проблема с "черной строкой состояния", добавление этого кода в мой файл
MainActivity.ktрешило проблему :)window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGESПолный код:
import io.flutter.embedding.android.FlutterActivity import android.os.Bundle import android.view.WindowManager class MainActivity : FlutterActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES } }Огромное тебе спасибо, я даже вошел в аккаунт чтобы это написать. Ты просто спас. Thank you BRO!!!
@rasitayaz Revisiting this issue, there have been breaking changes related to SystemUI modes that you can read here https://docs.flutter.dev/release/breaking-changes/default-systemuimode-edge-to-edge and check if this helps to resolve the issue at your end on affected device. Note that, you'll need to verify this using latest stable sdk (3.38.4).
- addedwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter respondsworkaround availableThere is a workaround available to overcome the issueThere is a workaround available to overcome the issuecustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.
on Dec 12, 2025 Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
Thanks for your contribution.This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on Jan 16, 2026
When I change
SystemUiModewhen rebuilding the app, the page's widgets are being moved and status bar area becomes completely black. This behavior occurs on my physical Android device which is Redmi Note 10 with operating system MIUI 12.However, it works as expected on Android emulator and also on my previous physical device with Android One operating system.
Steps to Reproduce
Expected results:
This video recording is from Android emulator, Nexus 5 and it works as expected.
Android.Emulator.-.nexus-5_5554.2021-12-16.16-43-04.mp4
Actual results:
And this recording is from my physical Redmi Note 10 device with MIUI 12 operating system. As you can see, area of the statusbar becomes completely black when I switch to immersive mode.
Screenrecorder-2021-12-16-16-41-03-7.mp4
Logs
flutter run --verboseflutter analyzeflutter doctor -v(I don't use Android Studio)