第一種:
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
statusBarIconBrightness: Brightness.dark,
statusBarBrightness:
!kIsWeb && Platform.isAndroid ? Brightness.dark : Brightness.light,
systemNavigationBarColor: Colors.white,
systemNavigationBarDividerColor: Colors.transparent,
systemNavigationBarIconBrightness: Brightness.dark,
));
第二種:
AnnotatedRegion<SystemUiOverlayStyle>(
value: context.watch<ThemeManager>().brightness == Brightness.dark
? SystemUiOverlayStyle.light.copyWith(
statusBarColor: Colors.grey.shade900.withOpacity(0.4),
systemNavigationBarColor: Colors.deepPurple.shade100,
// systemNavigationBarDividerColor: Colors.deepPurple.shade100,
systemNavigationBarIconBrightness: Brightness.dark)
: SystemUiOverlayStyle.dark.copyWith(
statusBarColor: Colors.grey.shade100.withOpacity(0.6),
systemNavigationBarColor: Colors.deepPurple.shade100,
// systemNavigationBarDividerColor: Colors.deepPurple.shade100,
systemNavigationBarIconBrightness: Brightness.dark),
child: MaterialApp
...
第三種:
AppBar(
systemOverlayStyle: SystemUiOverlayStyle.light,
),