Repository navigation
[Android]Switching between immersive and edgeToEdge system UI modes shows black status bar #95403
Copy link
Copy link
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: renderingUI glitches reported at the engine/skia or impeller rendering levelUI glitches reported at the engine/skia or impeller rendering levelcustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.e: device-specificOnly manifests on certain devicesOnly manifests on certain devicesframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.platform-androidAndroid applications specificallyAndroid applications specificallyteam-androidOwned by Android platform teamOwned by Android platform teamtriaged-androidTriaged by Android platform teamTriaged by Android platform teamwaiting 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 issue
Description
When I change SystemUiMode when 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
bool _fullscreenEnabled = false;
@override
Widget build(BuildContext context) {
SystemChrome.setEnabledSystemUIMode(
_fullscreenEnabled ? SystemUiMode.immersive : SystemUiMode.edgeToEdge,
);
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
systemNavigationBarColor: Colors.transparent,
));
return Scaffold(
body: GestureDetector(
onTap: () {
setState(() => _fullscreenEnabled = !_fullscreenEnabled);
},
child:
Image.network('https://www.wallpaperuse.com/wallp/83-836965_m.jpg'),
),
);
}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 --verbose
[ +70 ms] executing: [D:\SDK\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +66 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +1 ms] cf4400006550b70f28e4b4af815151d1e74846c6
[ ] executing: [D:\SDK\flutter/] git tag --points-at cf4400006550b70f28e4b4af815151d1e74846c6
[ +52 ms] Exit code 0 from: git tag --points-at cf4400006550b70f28e4b4af815151d1e74846c6
[ ] 2.8.0
[ +7 ms] executing: [D:\SDK\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[ +34 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ ] origin/stable
[ ] executing: [D:\SDK\flutter/] git ls-remote --get-url origin
[ +32 ms] Exit code 0 from: git ls-remote --get-url origin
[ ] https://github.com/flutter/flutter
[ +107 ms] executing: [D:\SDK\flutter/] git rev-parse --abbrev-ref HEAD
[ +37 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ ] stable
[ +81 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ +4 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +53 ms] executing: D:\SDK\android-sdk\platform-tools\adb.exe devices -l
[ +47 ms] List of devices attached
5974a77a device product:sunny_global model:M2101K7AG device:sunny transport_id:5
emulator-5554 device product:sdk_gphone_x86_64 model:Android_SDK_built_for_x86_64 device:generic_x86_64 transport_id:3
[ +9 ms] D:\SDK\android-sdk\platform-tools\adb.exe -s 5974a77a shell getprop
[ +121 ms] D:\SDK\android-sdk\platform-tools\adb.exe -s emulator-5554 shell getprop
[ +39 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ +14 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +72 ms] Multiple devices found:
[ +3 ms] ro.hardware = qcom
[ +1 ms] ro.hardware = ranchu
[ +26 ms] M2101K7AG (mobile) • 5974a77a • android-arm64 • Android 11 (API 30)
[ +1 ms] Android SDK built for x86 64 (mobile) • emulator-5554 • android-x64 • Android 10 (API 29) (emulator)
[ ] Chrome (web) • chrome • web-javascript • Google Chrome 96.0.4664.110
[ ] Edge (web) • edge • web-javascript • Microsoft Edge 96.0.1054.53
[ +2 ms] [1]: M2101K7AG (5974a77a)
[ ] [2]: Android SDK built for x86 64 (emulator-5554)
[ ] [3]: Chrome (chrome)
[ ] [4]: Edge (edge)
flutter analyze
Analyzing playground...
No issues found! (ran in 3.2s)
flutter doctor -v
[√] Flutter (Channel stable, 2.8.0, on Microsoft Windows [Version 10.0.19043.1348], locale en-US)
• Flutter version 2.8.0 at D:\SDK\flutter
• Upstream repository https://github.com/flutter/flutter
• 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 29.0.3)
• Android SDK at D:\SDK\android-sdk
• Platform android-30, build-tools 29.0.3
• ANDROID_SDK_ROOT = D:\SDK\android-sdk
• Java binary at: C:\Program Files\Common Files\Oracle\Java\javapath\java.exe
• Java version Java(TM) SE Runtime Environment (build 15.0.2+7-27)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
[√] VS Code (version 1.63.1)
• VS Code at C:\Users\rasit\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.29.0
[√] Connected device (4 available)
• M2101K7AG (mobile) • 5974a77a • android-arm64 • Android 11 (API 30)
• Android SDK built for x86 64 (mobile) • emulator-5554 • android-x64 • Android 10 (API 29) (emulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 96.0.4664.110
• Edge (web) • edge • web-javascript • Microsoft Edge 96.0.1054.53
! Doctor found issues in 1 category.
(I don't use Android Studio)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: renderingUI glitches reported at the engine/skia or impeller rendering levelUI glitches reported at the engine/skia or impeller rendering levelcustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.e: device-specificOnly manifests on certain devicesOnly manifests on certain devicesframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.platform-androidAndroid applications specificallyAndroid applications specificallyteam-androidOwned by Android platform teamOwned by Android platform teamtriaged-androidTriaged by Android platform teamTriaged by Android platform teamwaiting 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 issue
Activity
[-]Switching between immersive and edge to edge system UI modes causes unexpected behavior[/-][+]Switching between immersive and edgeToEdge system UI modes causes unexpected behavior[/+]maheshj01 commentedon 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
rasitayaz commentedon 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?maheshj01 commentedon Dec 21, 2021
I am not really aware of any other way.
fmotalleb commentedon Dec 21, 2021
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
emakar commentedon Dec 22, 2021
Well, 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 it
Other devices are unaffected
emakar commentedon Dec 22, 2021
Oh, I've just reproduced this on pixel 3 emulator (api 28)
emakar commentedon Dec 22, 2021
if I remove a call to
PlatformPlugin.updateSystemUiOverlays()everything becomes fine (debugging shows only default flags are used)13 remaining items
luneflu commentedon Nov 20, 2024
If someone still have the "black status bar" issue, adding this code in my
MainActivity.ktfixed the issue :)Full Code :
keybow007 commentedon Dec 4, 2024
This worked for me. I was very distressed and it helped! Thank you so much!
fondoger commentedon Jan 18, 2025
Worked for me too. This should be implemented as flutter's default behavior since it is edge to edge by default.
LuisJuniorA commentedon Feb 27, 2025
It works. Thanks !
Fizzzle commentedon Aug 5, 2025
Огромное тебе спасибо, я даже вошел в аккаунт чтобы это написать. Ты просто спас. Thank you BRO!!!
darshankawar commentedon Dec 12, 2025
@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).
github-actions commentedon Jan 2, 2026
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.
github-actions commentedon Jan 16, 2026
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.