I'm new to Flutter, I googled about this question but found no answer works for me.
My code is shown as below, the status bar color works well, it is white now. But the status bar text color on Android is also white, seems like the Brightness.dark
not working at all...
Your answer will be appreciated, thank you! <3
Widget build(BuildContext context) {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark.copyWith(
statusBarColor: Colors.white, // Color for Android
statusBarBrightness: Brightness.dark // Dark == white status bar -- for IOS.
));
return Scaffold(
body: Container(
...
}
According to the SystemUiOverLayStyle API docs, the text color of status bar on Android cannot be changed by statusBarBrightness
which is only honored in iOS.
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarColor: Colors.white, // Only honored in Android M and above
statusBarIconBrightness: Brightness.dark // Only honored in Android M and above
statusBarBrightness: Brightness.light, // Only honored in iOS
));
Hope this helps! Cheers
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다