light property
ThemeData
get
light
亮色主题
Implementation
static ThemeData get light {
return ThemeData(
///浅色
brightness: Brightness.light,
// 主要颜色: 导航/底部TabBar
primaryColor: LightColors.primary,
///scaffold的背景色
scaffoldBackgroundColor: LightColors.background,
cardColor: LightColors.card,
///去除水波纹
splashFactory: NoSplash.splashFactory,
///使用Material3 默认样式
useMaterial3: true,
///tab栏主题
tabBarTheme: BaseThemeData.tabBar.copyWith(
labelColor: LightColors.primary,
unselectedLabelColor: LightColors.supBody,
labelStyle: TextStyle(fontSize: 14.sp),
unselectedLabelStyle: TextStyle(fontSize: 14.sp),
indicatorSize: TabBarIndicatorSize.label,
splashFactory: InkRipple.splashFactory,
indicatorColor: LightColors.primary,
),
//状态栏主题
appBarTheme: BaseThemeData.appBar.copyWith(
backgroundColor: Colors.white,
titleTextStyle: TextStyles.appBarTitle.copyWith(
color: Colors.black,
),
),
///文字主题
textTheme: TextTheme(
titleLarge: TextStyles.titleLarge.copyWith(color: LightColors.title),
titleMedium: TextStyles.titleMedium.copyWith(color: LightColors.title),
titleSmall: TextStyles.titleSmall.copyWith(color: LightColors.title),
bodyLarge: TextStyles.bodyLarge.copyWith(color: LightColors.body),
bodyMedium: TextStyles.bodyMedium.copyWith(color: LightColors.body),
bodySmall: TextStyles.bodySmall.copyWith(color: LightColors.body),
),
///card
cardTheme: BaseThemeData.card.copyWith(color: LightColors.card),
///divider
dividerTheme: BaseThemeData.divider.copyWith(
color: LightColors.background,
),
///底部导航栏
bottomNavigationBarTheme: BaseThemeData.bottomNavigationBar.copyWith(
selectedItemColor: LightColors.primary,
unselectedItemColor: LightColors.textColor70,
),
///扩展
extensions: [
SupportColors(),
],
///
colorScheme: ColorScheme.fromSeed(
seedColor: LightColors.primary,
surface: Colors.white,
),
);
}