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:
@@ -87,7 +87,7 @@ class _WidgetManagementPageState extends ConsumerState<WidgetManagementPage> {
|
||||
const SizedBox(width: AppSpacing.sm),
|
||||
Text(
|
||||
'桌面小部件',
|
||||
style: AppTypography.of(context).title1.copyWith(
|
||||
style: AppTypography.title1.copyWith(
|
||||
color: ext.textPrimary,
|
||||
),
|
||||
),
|
||||
@@ -123,7 +123,7 @@ class _WidgetManagementPageState extends ConsumerState<WidgetManagementPage> {
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
_priorityLabel(entry.key),
|
||||
style: AppTypography.of(context).title3.copyWith(
|
||||
style: AppTypography.title3.copyWith(
|
||||
color: ext.textPrimary,
|
||||
),
|
||||
),
|
||||
@@ -161,7 +161,7 @@ class _WidgetManagementPageState extends ConsumerState<WidgetManagementPage> {
|
||||
padding: const EdgeInsets.all(AppSpacing.md),
|
||||
child: Text(
|
||||
'错误: ${widgetState.error}',
|
||||
style: AppTypography.of(context).footnote.copyWith(
|
||||
style: AppTypography.footnote.copyWith(
|
||||
color: CupertinoColors.systemRed,
|
||||
),
|
||||
),
|
||||
@@ -301,7 +301,7 @@ class _WidgetManagementPageState extends ConsumerState<WidgetManagementPage> {
|
||||
children: [
|
||||
Text(
|
||||
guideReason,
|
||||
style: AppTypography.of(context).footnote.copyWith(
|
||||
style: AppTypography.footnote.copyWith(
|
||||
color: ext.textSecondary,
|
||||
),
|
||||
),
|
||||
@@ -310,7 +310,7 @@ class _WidgetManagementPageState extends ConsumerState<WidgetManagementPage> {
|
||||
padding: const EdgeInsets.only(bottom: AppSpacing.xs),
|
||||
child: Text(
|
||||
s,
|
||||
style: AppTypography.of(context).subhead.copyWith(
|
||||
style: AppTypography.subhead.copyWith(
|
||||
color: ext.textPrimary,
|
||||
),
|
||||
),
|
||||
@@ -367,7 +367,7 @@ class _ThemeToggle extends StatelessWidget {
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
'同步主题',
|
||||
style: AppTypography.of(context).caption1.copyWith(
|
||||
style: AppTypography.caption1.copyWith(
|
||||
color: ext.accent,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
@@ -420,7 +420,7 @@ class _PlatformCompatibilityCard extends StatelessWidget {
|
||||
const SizedBox(width: AppSpacing.sm),
|
||||
Text(
|
||||
'平台兼容说明',
|
||||
style: AppTypography.of(context).subhead.copyWith(
|
||||
style: AppTypography.subhead.copyWith(
|
||||
color: ext.textPrimary,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
@@ -466,7 +466,7 @@ class _PlatformCompatibilityCard extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Text(
|
||||
'点击「同步主题」可将当前深色/浅色模式推送到所有已安装小部件',
|
||||
style: AppTypography.of(context).footnote.copyWith(
|
||||
style: AppTypography.footnote.copyWith(
|
||||
color: ext.textSecondary,
|
||||
),
|
||||
),
|
||||
@@ -505,14 +505,14 @@ class _PlatformRow extends StatelessWidget {
|
||||
children: [
|
||||
TextSpan(
|
||||
text: '$name ',
|
||||
style: AppTypography.of(context).subhead.copyWith(
|
||||
style: AppTypography.subhead.copyWith(
|
||||
color: ext.textPrimary,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: desc,
|
||||
style: AppTypography.of(context).footnote.copyWith(
|
||||
style: AppTypography.footnote.copyWith(
|
||||
color: ext.textSecondary,
|
||||
),
|
||||
),
|
||||
@@ -568,7 +568,7 @@ class _WidgetCard extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
type.title,
|
||||
style: AppTypography.of(context).subhead.copyWith(
|
||||
style: AppTypography.subhead.copyWith(
|
||||
color: ext.textPrimary,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
@@ -580,7 +580,7 @@ class _WidgetCard extends StatelessWidget {
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
type.subtitle,
|
||||
style: AppTypography.of(context).footnote.copyWith(
|
||||
style: AppTypography.footnote.copyWith(
|
||||
color: ext.textSecondary,
|
||||
),
|
||||
),
|
||||
@@ -600,7 +600,7 @@ class _WidgetCard extends StatelessWidget {
|
||||
),
|
||||
child: Text(
|
||||
'已安装',
|
||||
style: AppTypography.of(context).caption2.copyWith(
|
||||
style: AppTypography.caption2.copyWith(
|
||||
color: CupertinoColors.systemGreen,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
@@ -620,7 +620,7 @@ class _WidgetCard extends StatelessWidget {
|
||||
? const CupertinoActivityIndicator(radius: 8)
|
||||
: Text(
|
||||
'添加',
|
||||
style: AppTypography.of(context).caption2.copyWith(
|
||||
style: AppTypography.caption2.copyWith(
|
||||
color: CupertinoColors.white,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
@@ -670,7 +670,7 @@ class _PriorityBadge extends StatelessWidget {
|
||||
),
|
||||
child: Text(
|
||||
label,
|
||||
style: AppTypography.of(context).caption2.copyWith(
|
||||
style: AppTypography.caption2.copyWith(
|
||||
color: color,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 9,
|
||||
@@ -716,7 +716,7 @@ class _Badge extends StatelessWidget {
|
||||
),
|
||||
child: Text(
|
||||
supported ? label : '$label✗',
|
||||
style: AppTypography.of(context).caption2.copyWith(
|
||||
style: AppTypography.caption2.copyWith(
|
||||
color: supported
|
||||
? CupertinoColors.systemGreen
|
||||
: CupertinoColors.systemGrey,
|
||||
@@ -742,7 +742,7 @@ class _DeepLinkBadge extends StatelessWidget {
|
||||
const SizedBox(width: 2),
|
||||
Text(
|
||||
route,
|
||||
style: AppTypography.of(context).caption2.copyWith(
|
||||
style: AppTypography.caption2.copyWith(
|
||||
color: ext.textSecondary,
|
||||
fontSize: 9,
|
||||
),
|
||||
@@ -840,7 +840,7 @@ class _WidgetDataPreviewState extends ConsumerState<_WidgetDataPreview> {
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
'数据预览',
|
||||
style: AppTypography.of(context).caption2.copyWith(
|
||||
style: AppTypography.caption2.copyWith(
|
||||
color: ext.textSecondary,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
@@ -859,7 +859,7 @@ class _WidgetDataPreviewState extends ConsumerState<_WidgetDataPreview> {
|
||||
const SizedBox(width: 2),
|
||||
Text(
|
||||
'刷新',
|
||||
style: AppTypography.of(context).caption2.copyWith(
|
||||
style: AppTypography.caption2.copyWith(
|
||||
color: ext.accent,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
@@ -885,7 +885,7 @@ class _WidgetDataPreviewState extends ConsumerState<_WidgetDataPreview> {
|
||||
),
|
||||
child: Text(
|
||||
_getPreviewText(),
|
||||
style: AppTypography.of(context).footnote.copyWith(
|
||||
style: AppTypography.footnote.copyWith(
|
||||
color: ext.textPrimary,
|
||||
),
|
||||
maxLines: 2,
|
||||
|
||||
Reference in New Issue
Block a user