fix;设置和深浅色
This commit is contained in:
+12
-11
@@ -17,6 +17,7 @@ class AppBadge extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colors = ShadTheme.of(context).colorScheme;
|
||||
final child = Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
@@ -27,7 +28,7 @@ class AppBadge extends StatelessWidget {
|
||||
final shape = RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(YantingRadius.sm),
|
||||
side: kind == BadgeKind.tier || kind == BadgeKind.warning
|
||||
? const BorderSide(color: YantingColors.border)
|
||||
? BorderSide(color: colors.border)
|
||||
: BorderSide.none,
|
||||
);
|
||||
|
||||
@@ -45,14 +46,15 @@ class AppBadge extends StatelessWidget {
|
||||
BadgeKind.tier => ShadBadge.outline(
|
||||
shape: shape,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 9, vertical: 3),
|
||||
foregroundColor: YantingColors.mutedForeground,
|
||||
foregroundColor: colors.mutedForeground,
|
||||
child: child,
|
||||
),
|
||||
BadgeKind.warning => ShadBadge.destructive(
|
||||
shape: shape,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 9, vertical: 3),
|
||||
backgroundColor: YantingColors.background,
|
||||
foregroundColor: YantingColors.destructive,
|
||||
backgroundColor: colors.warningSoft,
|
||||
foregroundColor: colors.warningSoftForeground,
|
||||
hoverBackgroundColor: colors.warningSoftBorder,
|
||||
child: child,
|
||||
),
|
||||
};
|
||||
@@ -75,19 +77,18 @@ class AppChip extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colors = ShadTheme.of(context).colorScheme;
|
||||
return ShadBadge.secondary(
|
||||
onPressed: onTap,
|
||||
shape: const StadiumBorder(),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 17, vertical: 9),
|
||||
backgroundColor: selected
|
||||
? YantingColors.foreground
|
||||
: YantingColors.secondary,
|
||||
backgroundColor: selected ? colors.foreground : colors.secondary,
|
||||
hoverBackgroundColor: selected
|
||||
? YantingColors.foreground.withValues(alpha: 0.9)
|
||||
: YantingColors.border,
|
||||
? colors.foreground.withValues(alpha: 0.9)
|
||||
: colors.border,
|
||||
foregroundColor: selected
|
||||
? YantingColors.background
|
||||
: YantingColors.secondaryForeground,
|
||||
? colors.background
|
||||
: colors.secondaryForeground,
|
||||
child: Text(label),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user