Files
xueguang_flutter_app/lib/global/theme/base/app_text_style.dart
2025-11-28 18:01:09 +08:00

55 lines
1.3 KiB
Dart

import 'package:flutter/material.dart';
import 'app_colors_base.dart'; // 假设你之前定义了 AppColorsBase
TextTheme buildTextTheme(AppColorsBase colors) {
return TextTheme(
// 标题层级
titleLarge: TextStyle(
fontSize: 22, // 比正文大6
fontWeight: FontWeight.w700,
color: colors.textPrimary,
),
titleMedium: TextStyle(
fontSize: 20, // 比正文大4
fontWeight: FontWeight.w700,
color: colors.textPrimary,
),
titleSmall: TextStyle(
fontSize: 18, // 比正文大2
fontWeight: FontWeight.w700,
color: colors.textPrimary,
),
// 正文字体
bodyLarge: TextStyle(
fontSize: 18, // 稍大正文
color: colors.textPrimary,
),
bodyMedium: TextStyle(
fontSize: 16, // 正文标准
color: colors.textPrimary,
),
bodySmall: TextStyle(
fontSize: 14, // 辅助正文
color: colors.textPrimary,
),
// 标签/提示文字
labelLarge: TextStyle(
fontSize: 14, // 比正文小一点
fontWeight: FontWeight.w500,
color: colors.textSecondary,
),
labelMedium: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w500,
color: colors.textSecondary,
),
labelSmall: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w400,
color: colors.textSecondary,
),
);
}