fix:按照shadcn_ui对着demo_shadcn对齐
This commit is contained in:
+19
-18
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
|
||||
import '../theme/yanting_tokens.dart';
|
||||
|
||||
@@ -20,29 +21,29 @@ class AppCard extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final decoration = BoxDecoration(
|
||||
color: color,
|
||||
border: Border.all(color: borderColor),
|
||||
borderRadius: BorderRadius.circular(YantingRadius.xl),
|
||||
);
|
||||
final content = DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: color,
|
||||
border: Border.all(color: borderColor),
|
||||
borderRadius: BorderRadius.circular(YantingRadius.xl),
|
||||
),
|
||||
child: Padding(padding: padding, child: child),
|
||||
final theme = ShadTheme.of(context);
|
||||
final radius = BorderRadius.circular(YantingRadius.xl);
|
||||
final content = ShadCard(
|
||||
padding: padding,
|
||||
backgroundColor: color,
|
||||
radius: radius,
|
||||
border: ShadBorder.all(color: borderColor),
|
||||
shadows: const [],
|
||||
child: child,
|
||||
);
|
||||
if (onTap == null) return content;
|
||||
|
||||
return Material(
|
||||
color: Colors.transparent,
|
||||
child: Ink(
|
||||
decoration: decoration,
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(YantingRadius.xl),
|
||||
onTap: onTap,
|
||||
child: Padding(padding: padding, child: child),
|
||||
borderRadius: radius,
|
||||
child: InkWell(
|
||||
borderRadius: radius,
|
||||
splashColor: theme.colorScheme.mutedForeground.withValues(alpha: 0.08),
|
||||
highlightColor: theme.colorScheme.mutedForeground.withValues(
|
||||
alpha: 0.04,
|
||||
),
|
||||
onTap: onTap,
|
||||
child: content,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user