refactor: 完成AppTypography Token化重构,统一UI样式调用

1. 将AppTypography从静态常量类重构为ThemeExtension+静态实例模式,支持全局响应式字体调整
2. 批量替换全量代码中的AppTypography.of(context)调用为静态直接调用
3. 移除多余的rank_provider、canvas_style_middleware导入和preload静态方法
4. 修复多处UI文本样式不一致的问题,统一字体样式调用逻辑
This commit is contained in:
Developer
2026-05-24 09:29:06 +08:00
parent 09d68cd6aa
commit 6da28be851
250 changed files with 2811 additions and 2802 deletions

View File

@@ -37,7 +37,7 @@ class _CountdownPageState extends ConsumerState<CountdownPage> {
leading: const AdaptiveBackButton(),
middle: Text(
'⏰ 倒计时',
style: AppTypography.of(context).title3.copyWith(color: ext.textPrimary),
style: AppTypography.title3.copyWith(color: ext.textPrimary),
),
backgroundColor: ext.bgPrimary.withValues(alpha: 0.85),
border: null,
@@ -76,7 +76,7 @@ class _CountdownPageState extends ConsumerState<CountdownPage> {
const SizedBox(height: AppSpacing.md),
Text(
'暂无倒计时',
style: AppTypography.of(context).body.copyWith(color: ext.textHint),
style: AppTypography.body.copyWith(color: ext.textHint),
),
const SizedBox(height: AppSpacing.md),
CupertinoButton.filled(
@@ -128,7 +128,7 @@ class _CountdownPageState extends ConsumerState<CountdownPage> {
padding: const EdgeInsets.only(bottom: 10),
child: Text(
title,
style: AppTypography.of(context).callout.copyWith(
style: AppTypography.callout.copyWith(
fontWeight: FontWeight.w600,
color: ext.textSecondary,
),
@@ -184,7 +184,7 @@ class _CountdownPageState extends ConsumerState<CountdownPage> {
children: [
Text(
event.title,
style: AppTypography.of(context).body.copyWith(
style: AppTypography.body.copyWith(
fontWeight: FontWeight.w600,
color: isPast ? ext.textHint : ext.textPrimary,
),
@@ -192,7 +192,7 @@ class _CountdownPageState extends ConsumerState<CountdownPage> {
const SizedBox(height: AppSpacing.xs),
Text(
_formatDate(event.targetDate),
style: AppTypography.of(context).footnote.copyWith(
style: AppTypography.footnote.copyWith(
color: ext.textHint,
),
),
@@ -204,7 +204,7 @@ class _CountdownPageState extends ConsumerState<CountdownPage> {
children: [
Text(
event.isToday ? '🎉' : '${event.daysRemaining.abs()}',
style: AppTypography.of(context).title1.copyWith(
style: AppTypography.title1.copyWith(
fontWeight: FontWeight.w300,
color: isPast ? ext.textDisabled : color,
fontSize: event.isToday ? 24 : 28,
@@ -212,7 +212,7 @@ class _CountdownPageState extends ConsumerState<CountdownPage> {
),
Text(
event.remainingLabel,
style: AppTypography.of(context).caption1.copyWith(
style: AppTypography.caption1.copyWith(
color: isPast ? ext.textDisabled : ext.textSecondary,
),
),
@@ -352,7 +352,7 @@ class _CountdownPageState extends ConsumerState<CountdownPage> {
Center(
child: Text(
existing != null ? '编辑倒计时' : '新建倒计时',
style: AppTypography.of(context).headline.copyWith(
style: AppTypography.headline.copyWith(
fontWeight: FontWeight.w600,
color: ext.textPrimary,
),
@@ -403,7 +403,7 @@ class _CountdownPageState extends ConsumerState<CountdownPage> {
children: [
Text(
'📅 日期',
style: AppTypography.of(context).subhead.copyWith(
style: AppTypography.subhead.copyWith(
color: ext.textSecondary,
),
),
@@ -431,7 +431,7 @@ class _CountdownPageState extends ConsumerState<CountdownPage> {
},
child: Text(
_formatDate(selectedDate),
style: AppTypography.of(context).subhead.copyWith(
style: AppTypography.subhead.copyWith(
color: ext.accent,
fontWeight: FontWeight.w500,
),
@@ -442,7 +442,7 @@ class _CountdownPageState extends ConsumerState<CountdownPage> {
const SizedBox(height: AppSpacing.md),
Text(
'分类',
style: AppTypography.of(context).subhead.copyWith(
style: AppTypography.subhead.copyWith(
color: ext.textSecondary,
),
),
@@ -475,7 +475,7 @@ class _CountdownPageState extends ConsumerState<CountdownPage> {
),
child: Text(
'${cat.emoji} ${cat.label}',
style: AppTypography.of(context).footnote.copyWith(
style: AppTypography.footnote.copyWith(
color: isActive
? ext.accent
: ext.textSecondary,