I hope to control the statusbar text color in iOS 13 Dark Mode. I could change the statusbar color by setting the Scaffold's AppBar property "brightness" When not open the Dark Mode. Codes just like below:
return Scaffold(
appBar: AppBar(
brightness: Brightness.light, //<--Here!!!
title: Text(widget.title),
),
...
The effort just like this:
But when I enable the simulator's Dark Mode, the method is not working.
Open the simulator's "Dark Appearance":
After opening the "Dark Appearance", the statusbar text color couldn't change any more by the method, it's just in white color(lightness mode).
I have tried those method to change statusbar text color:
Method 1:
void main() {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light);
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown
]);
runApp(MyApp());
}
Method 2:
return AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle.light,
child: Material(
child: Scaffold(
appBar: AppBar(
brightness: Brightness.light,
title: Text(widget.title),
),
body: Center(
But neither of them could work.
Hope your help! Thank you.