refactor(client): widgets 颜色迁移到 context.tokens
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@ import 'dart:typed_data';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import '../core/errors/error_reporter.dart';
|
||||
import '../core/theme/app_theme.dart';
|
||||
import '../core/theme/context_tokens.dart';
|
||||
import '../core/responsive/responsive.dart';
|
||||
import '../core/utils/print_util.dart';
|
||||
import '../core/utils/label_data.dart';
|
||||
@@ -164,13 +164,13 @@ class _LabelPreviewDialogState extends State<LabelPreviewDialog> {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 6),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: isSelected ? AppTheme.primary : AppTheme.border,
|
||||
color: isSelected ? context.tokens.primary : context.tokens.border,
|
||||
width: isSelected ? 2 : 1,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
color: isSelected
|
||||
? AppTheme.primary.withOpacity(0.04)
|
||||
: AppTheme.surface,
|
||||
? context.tokens.primary.withOpacity(0.04)
|
||||
: context.tokens.surface,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
@@ -204,8 +204,8 @@ class _LabelPreviewDialogState extends State<LabelPreviewDialog> {
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: isSelected
|
||||
? AppTheme.primary
|
||||
: AppTheme.textSecondary,
|
||||
? context.tokens.primary
|
||||
: context.tokens.muted,
|
||||
fontWeight:
|
||||
isSelected ? FontWeight.w600 : FontWeight.normal,
|
||||
),
|
||||
@@ -228,7 +228,7 @@ class _LabelPreviewDialogState extends State<LabelPreviewDialog> {
|
||||
child: Container(
|
||||
constraints: const BoxConstraints(maxWidth: 420, maxHeight: 230),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: AppTheme.border),
|
||||
border: Border.all(color: context.tokens.border),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
color: Colors.white,
|
||||
),
|
||||
@@ -297,9 +297,9 @@ class _LabelPreviewDialogState extends State<LabelPreviewDialog> {
|
||||
Container(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 20, vertical: 14),
|
||||
decoration: const BoxDecoration(
|
||||
color: AppTheme.primary,
|
||||
borderRadius: BorderRadius.only(
|
||||
decoration: BoxDecoration(
|
||||
color: context.tokens.primary,
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(12),
|
||||
topRight: Radius.circular(12),
|
||||
),
|
||||
@@ -334,24 +334,24 @@ class _LabelPreviewDialogState extends State<LabelPreviewDialog> {
|
||||
child: _printers.isEmpty
|
||||
? Text(
|
||||
_printersChecked ? '无打印机可用' : '正在检测打印机...',
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: AppTheme.textSecondary))
|
||||
color: context.tokens.muted))
|
||||
: DropdownButtonHideUnderline(
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: AppTheme.border),
|
||||
border: Border.all(color: context.tokens.border),
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
child: DropdownButton<String>(
|
||||
value: _printer,
|
||||
isExpanded: true,
|
||||
isDense: true,
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: AppTheme.textPrimary),
|
||||
color: context.tokens.text),
|
||||
items: _printers
|
||||
.map((p) => DropdownMenuItem(
|
||||
value: p,
|
||||
@@ -410,8 +410,8 @@ class _LabelPreviewDialogState extends State<LabelPreviewDialog> {
|
||||
Expanded(
|
||||
child: Text(
|
||||
_status,
|
||||
style: const TextStyle(
|
||||
fontSize: 12, color: AppTheme.textSecondary),
|
||||
style: TextStyle(
|
||||
fontSize: 12, color: context.tokens.muted),
|
||||
),
|
||||
)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user