setStatusBarColor function
Future<void>
setStatusBarColor(
- Color statusBarColor, {
- Brightness? statusBarBrightness,
- Brightness? statusBarIconBrightness,
- int delayInMilliSeconds = 200,
Change status bar Color and Brightness
Implementation
Future<void> setStatusBarColor(
Color statusBarColor, {
Color? systemNavigationBarColor,
Brightness? statusBarBrightness,
Brightness? statusBarIconBrightness,
int delayInMilliSeconds = 200,
}) async {
await Future.delayed(Duration(milliseconds: delayInMilliSeconds));
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(
statusBarColor: statusBarColor,
systemNavigationBarColor: systemNavigationBarColor,
statusBarBrightness: statusBarBrightness,
statusBarIconBrightness: statusBarIconBrightness ??
(statusBarColor.isDark() ? Brightness.light : Brightness.dark),
),
);
}