import 'package:flutter/material.dart'; import 'app_colors.dart'; /// 应用主题配置 class AppTheme { static ThemeData lightTheme = ThemeData( useMaterial3: true, fontFamily: 'Noto Sans SC', colorScheme: ColorScheme.fromSeed( seedColor: AppColors.primary, brightness: Brightness.light, ), // 卡片主题 cardTheme: CardThemeData( elevation: 2, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), ), // 按钮主题 elevatedButtonTheme: ElevatedButtonThemeData( style: ElevatedButton.styleFrom( elevation: 0, padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)), ), ), // 输入框主题 inputDecorationTheme: InputDecorationTheme( border: OutlineInputBorder( borderRadius: BorderRadius.circular(6), borderSide: const BorderSide(color: AppColors.border), ), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(6), borderSide: const BorderSide(color: AppColors.border), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(6), borderSide: const BorderSide(color: AppColors.primary, width: 2), ), contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), ), // 文本主题 textTheme: const TextTheme( displayLarge: TextStyle( fontSize: 32, fontWeight: FontWeight.bold, color: AppColors.textPrimary, ), displayMedium: TextStyle( fontSize: 28, fontWeight: FontWeight.bold, color: AppColors.textPrimary, ), displaySmall: TextStyle( fontSize: 24, fontWeight: FontWeight.bold, color: AppColors.textPrimary, ), headlineLarge: TextStyle( fontSize: 20, fontWeight: FontWeight.w600, color: AppColors.textPrimary, ), headlineMedium: TextStyle( fontSize: 18, fontWeight: FontWeight.w600, color: AppColors.textPrimary, ), headlineSmall: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, color: AppColors.textPrimary, ), bodyLarge: TextStyle(fontSize: 16, color: AppColors.textPrimary), bodyMedium: TextStyle(fontSize: 14, color: AppColors.textPrimary), bodySmall: TextStyle(fontSize: 12, color: AppColors.textSecondary), ), // 应用栏主题 appBarTheme: const AppBarTheme( elevation: 0, centerTitle: false, backgroundColor: AppColors.backgroundLight, foregroundColor: AppColors.textPrimary, ), // 分割线主题 dividerTheme: const DividerThemeData( color: AppColors.borderLight, thickness: 1, space: 1, ), ); static ThemeData darkTheme = ThemeData( useMaterial3: true, fontFamily: 'Noto Sans SC', colorScheme: ColorScheme.fromSeed( seedColor: AppColors.primary, brightness: Brightness.dark, ), ); }