fix;设置和深浅色

This commit is contained in:
jingyun
2026-06-05 17:54:46 +08:00
parent 33d04a5545
commit af865b13fb
24 changed files with 742 additions and 290 deletions
+15 -7
View File
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:shadcn_ui/shadcn_ui.dart';
import '../theme/yanting_tokens.dart';
@@ -20,11 +21,17 @@ class AppCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
final radius = BorderRadius.circular(YantingRadius.xl);
final theme = ShadTheme.of(context);
final colors = theme.colorScheme;
final radius = theme.radius.resolve(TextDirection.ltr);
final decoration = BoxDecoration(
color: color,
color: color == YantingColors.card ? colors.card : color,
borderRadius: radius,
border: Border.all(color: borderColor),
border: Border.all(
color: borderColor == YantingColors.border
? colors.border
: borderColor,
),
);
if (onTap == null) {
return DecoratedBox(
@@ -40,8 +47,8 @@ class AppCard extends StatelessWidget {
decoration: decoration,
child: InkWell(
borderRadius: radius,
splashColor: YantingColors.mutedForeground.withValues(alpha: 0.08),
highlightColor: YantingColors.mutedForeground.withValues(alpha: 0.04),
splashColor: colors.mutedForeground.withValues(alpha: 0.08),
highlightColor: colors.mutedForeground.withValues(alpha: 0.04),
onTap: onTap,
child: Padding(padding: padding, child: child),
),
@@ -58,10 +65,11 @@ class HeroReportCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
final colors = ShadTheme.of(context).colorScheme;
return AppCard(
onTap: onTap,
color: YantingColors.brandSoft,
borderColor: YantingColors.brandSoftBorder,
color: colors.brandSoft,
borderColor: colors.brandSoftBorder,
padding: const EdgeInsets.all(YantingSpacing.cardPadding),
child: child,
);