Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 8101136

Browse files
jayjuncbracken
authored andcommitted
Use iOS 13 dark content status bar style (#13119)
1 parent 08fd50a commit 8101136

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,17 +166,22 @@ - (void)restoreSystemChromeSystemUIOverlays {
166166
}
167167

168168
- (void)setSystemChromeSystemUIOverlayStyle:(NSDictionary*)message {
169-
NSString* style = message[@"statusBarBrightness"];
170-
if (style == (id)[NSNull null])
169+
NSString* brightness = message[@"statusBarBrightness"];
170+
if (brightness == (id)[NSNull null])
171171
return;
172172

173173
UIStatusBarStyle statusBarStyle;
174-
if ([style isEqualToString:@"Brightness.dark"])
174+
if ([brightness isEqualToString:@"Brightness.dark"]) {
175175
statusBarStyle = UIStatusBarStyleLightContent;
176-
else if ([style isEqualToString:@"Brightness.light"])
177-
statusBarStyle = UIStatusBarStyleDefault;
178-
else
176+
} else if ([brightness isEqualToString:@"Brightness.light"]) {
177+
if (@available(iOS 13, *)) {
178+
statusBarStyle = UIStatusBarStyleDarkContent;
179+
} else {
180+
statusBarStyle = UIStatusBarStyleDefault;
181+
}
182+
} else {
179183
return;
184+
}
180185

181186
NSNumber* infoValue = [[NSBundle mainBundle]
182187
objectForInfoDictionaryKey:@"UIViewControllerBasedStatusBarAppearance"];

0 commit comments

Comments
 (0)