Reputation: 329
How do you change the status bar text color to black when its in dark mode? I can't find an answer for dark mode only in flutter.
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Fry',
theme: ThemeData(),
darkTheme: ThemeData(
),
home: Loader(),
routes: {
MainMenu.id : (context) => MainMenu(),
},
debugShowCheckedModeBanner: false,
);
}
}
Upvotes: 1
Views: 482
Reputation: 7931
for iOS open Info.plist
, it is under ios/Runner and add that;
<key>UIUserInterfaceStyle</key>
<string>Light</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
and import services library to your main.dart file;
import 'package:flutter/services.dart';
and use this to change the status bar color;
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(statusBarBrightness: Brightness.light)
);
Upvotes: 3