refactor(client): widgets 颜色迁移到 context.tokens
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,7 @@ import '../core/utils/dialog_util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../core/responsive/responsive.dart';
|
||||
import 'package:lpinyin/lpinyin.dart';
|
||||
import '../core/theme/app_theme.dart';
|
||||
import '../core/theme/context_tokens.dart';
|
||||
|
||||
class OptionItem {
|
||||
final int id;
|
||||
@@ -100,18 +100,18 @@ class SearchableOptionField extends StatelessWidget {
|
||||
suffixIcon: selected
|
||||
? GestureDetector(
|
||||
onTap: () => onChanged(null),
|
||||
child: const Icon(Icons.close,
|
||||
size: 14, color: AppTheme.textSecondary),
|
||||
child: Icon(Icons.close,
|
||||
size: 14, color: context.tokens.muted),
|
||||
)
|
||||
: const Icon(Icons.arrow_drop_down,
|
||||
size: 16, color: AppTheme.textSecondary),
|
||||
: Icon(Icons.arrow_drop_down,
|
||||
size: 16, color: context.tokens.muted),
|
||||
),
|
||||
isEmpty: !selected,
|
||||
child: Text(
|
||||
selected ? _displayText : hint,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: selected ? Colors.black87 : AppTheme.textSecondary,
|
||||
color: selected ? Colors.black87 : context.tokens.muted,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
@@ -269,7 +269,7 @@ class _SearchDialogState extends State<_SearchDialog> {
|
||||
? Center(
|
||||
child: Text(
|
||||
canCreate ? '无匹配结果,可新增到基础数据' : '无匹配结果',
|
||||
style: const TextStyle(color: AppTheme.textSecondary),
|
||||
style: TextStyle(color: context.tokens.muted),
|
||||
),
|
||||
)
|
||||
: ListView.builder(
|
||||
@@ -287,7 +287,7 @@ class _SearchDialogState extends State<_SearchDialog> {
|
||||
: null,
|
||||
selected: isSelected,
|
||||
selectedTileColor:
|
||||
AppTheme.primary.withValues(alpha: 0.08),
|
||||
context.tokens.primary.withValues(alpha: 0.08),
|
||||
onTap: () => Navigator.of(context).pop(opt.id),
|
||||
);
|
||||
},
|
||||
@@ -316,8 +316,8 @@ class _SearchDialogState extends State<_SearchDialog> {
|
||||
if (widget.selectedId != null)
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(-1),
|
||||
child: const Text('清除选择',
|
||||
style: TextStyle(color: AppTheme.textSecondary)),
|
||||
child: Text('清除选择',
|
||||
style: TextStyle(color: context.tokens.muted)),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(null),
|
||||
|
||||
Reference in New Issue
Block a user