theme_config.dart 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import 'package:flutter/cupertino.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:flutter/services.dart';
  4. class ThemeConfig {
  5. //亮色模式模式下的状态栏与导航栏设置 (默认黑色状态栏文本,白色导航栏)
  6. static SystemUiOverlayStyle get systemUiOverlayStyleLightThemeBlack {
  7. return SystemUiOverlayStyle.light.copyWith(
  8. statusBarColor: Colors.transparent,
  9. //顶部导航栏的状态栏背景颜色
  10. statusBarBrightness: Brightness.light,
  11. //顶部状态栏颜色模式
  12. statusBarIconBrightness: Brightness.dark,
  13. //顶部状态栏Icon与文本颜色模式
  14. systemNavigationBarDividerColor: Colors.transparent,
  15. //底部导航栏分割线颜色
  16. systemNavigationBarColor: Colors.white,
  17. //底部导航栏背景颜色
  18. systemNavigationBarIconBrightness: Brightness.dark, //底部导航栏三大金刚键的颜色模式
  19. );
  20. }
  21. //亮色模式模式下的状态栏与导航栏设置 (设置白色状态栏文本,白色导航栏)
  22. static SystemUiOverlayStyle get systemUiOverlayStyleLightThemeWhite {
  23. return SystemUiOverlayStyle.light.copyWith(
  24. statusBarColor: Colors.transparent,
  25. statusBarBrightness: Brightness.dark,
  26. statusBarIconBrightness: Brightness.light,
  27. systemNavigationBarDividerColor: Colors.transparent,
  28. systemNavigationBarColor: Colors.white,
  29. systemNavigationBarIconBrightness: Brightness.dark,
  30. );
  31. }
  32. //黑暗模式下,统一使用白色状态栏文本,黑色导航栏
  33. static SystemUiOverlayStyle get systemUiOverlayStyleDarkTheme {
  34. return SystemUiOverlayStyle.dark.copyWith(
  35. statusBarColor: Colors.transparent,
  36. statusBarBrightness: Brightness.dark,
  37. statusBarIconBrightness: Brightness.light,
  38. );
  39. }
  40. }