refactor(client): widgets 颜色迁移到 context.tokens
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import '../core/utils/dialog_util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../core/theme/app_theme.dart';
|
||||
import '../core/theme/context_tokens.dart';
|
||||
|
||||
/// Compact button → dialog with checkboxes for multi-select filtering
|
||||
class MultiSelectDropdown extends StatelessWidget {
|
||||
@@ -23,8 +23,8 @@ class MultiSelectDropdown extends StatelessWidget {
|
||||
return OutlinedButton(
|
||||
onPressed: options.isEmpty ? null : () => _show(context),
|
||||
style: OutlinedButton.styleFrom(
|
||||
foregroundColor: active ? AppTheme.primary : AppTheme.textSecondary,
|
||||
side: BorderSide(color: active ? AppTheme.primary : AppTheme.border),
|
||||
foregroundColor: active ? context.tokens.primary : context.tokens.muted,
|
||||
side: BorderSide(color: active ? context.tokens.primary : context.tokens.border),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),
|
||||
minimumSize: Size.zero,
|
||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
@@ -143,8 +143,8 @@ class _MultiSelectDialogState extends State<_MultiSelectDialog> {
|
||||
onDeleted: () => setState(() => _selected.remove(s)),
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
visualDensity: VisualDensity.compact,
|
||||
backgroundColor: AppTheme.primary.withOpacity(0.08),
|
||||
side: BorderSide(color: AppTheme.primary.withOpacity(0.3), width: 0.5),
|
||||
backgroundColor: context.tokens.primary.withOpacity(0.08),
|
||||
side: BorderSide(color: context.tokens.primary.withOpacity(0.3), width: 0.5),
|
||||
labelPadding: const EdgeInsets.symmetric(horizontal: 2),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 0),
|
||||
)).toList(),
|
||||
@@ -168,12 +168,12 @@ class _MultiSelectDialogState extends State<_MultiSelectDialog> {
|
||||
ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxHeight: 280),
|
||||
child: filtered.isEmpty
|
||||
? const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 16),
|
||||
? Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
child: Center(
|
||||
child: Text('无匹配项',
|
||||
style: TextStyle(
|
||||
fontSize: 13, color: AppTheme.textSecondary)),
|
||||
fontSize: 13, color: context.tokens.muted)),
|
||||
),
|
||||
)
|
||||
: ListView(
|
||||
@@ -256,7 +256,7 @@ class _FilterableColumnHeaderState extends State<FilterableColumnHeader> {
|
||||
child: Icon(
|
||||
active ? Icons.filter_alt : Icons.filter_alt_outlined,
|
||||
size: 16,
|
||||
color: active ? AppTheme.primary : AppTheme.textSecondary,
|
||||
color: active ? context.tokens.primary : context.tokens.muted,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -264,8 +264,8 @@ class _FilterableColumnHeaderState extends State<FilterableColumnHeader> {
|
||||
InkWell(
|
||||
onTap: () => widget.onChanged({}),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
child: const Icon(Icons.cancel, size: 14,
|
||||
color: AppTheme.primary),
|
||||
child: Icon(Icons.cancel, size: 14,
|
||||
color: context.tokens.primary),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -327,8 +327,8 @@ class ColumnToggleButton extends StatelessWidget {
|
||||
return OutlinedButton(
|
||||
onPressed: () => _show(context),
|
||||
style: OutlinedButton.styleFrom(
|
||||
foregroundColor: AppTheme.textSecondary,
|
||||
side: const BorderSide(color: AppTheme.border),
|
||||
foregroundColor: context.tokens.muted,
|
||||
side: BorderSide(color: context.tokens.border),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),
|
||||
minimumSize: Size.zero,
|
||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
|
||||
Reference in New Issue
Block a user