44 lines
1.6 KiB
Dart
44 lines
1.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'base/app_colors_base.dart';
|
|
import 'base/app_text_style.dart';
|
|
import 'base/app_theme_ext.dart';
|
|
|
|
class AppTheme {
|
|
static ThemeData createTheme(AppColorsBase themeBase) {
|
|
final textTheme = buildTextTheme(themeBase);
|
|
return ThemeData(
|
|
useMaterial3: true,
|
|
primaryColor: themeBase.primary,
|
|
scaffoldBackgroundColor: themeBase.surfaceContainerHigh,
|
|
colorScheme: ColorScheme.fromSeed(
|
|
seedColor: themeBase.primary,
|
|
secondary: themeBase.secondary,
|
|
primary: themeBase.primary,
|
|
brightness: Brightness.light,
|
|
|
|
onSurfaceVariant: themeBase.textSecondary,
|
|
//背景色
|
|
surfaceContainerHigh: themeBase.surfaceContainerHigh,
|
|
surfaceContainer: themeBase.surfaceContainer,
|
|
surfaceContainerLow: themeBase.surfaceContainerLow,
|
|
surfaceContainerLowest: themeBase.surfaceContainerLowest,
|
|
),
|
|
textTheme: textTheme,
|
|
extensions: [AppThemeExtension.fromColors(themeBase)],
|
|
appBarTheme: AppBarTheme(
|
|
backgroundColor: Colors.white,
|
|
titleTextStyle: textTheme.titleMedium,
|
|
scrolledUnderElevation: 0,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
// background = Color(0xFFFFFBFE); // 页面背景
|
|
// surface = Color(0xFFFFFFFF); // 卡片背景
|
|
// surfaceVariant = Color(0xFFFFF7E0); // 卡片高亮 / 强调背景
|
|
// surfaceTint = Color(0xFFFFEF97); // 可用于叠加高亮
|
|
// primaryContainer = Color(0xFFFFF8B0); // 小块强调背景
|
|
// secondaryContainer= Color(0xFFE3E5C0); // 次要强调
|