fix;设置和深浅色
This commit is contained in:
@@ -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,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user