- 欢迎卡片:去掉白框圆角错位、图片满宽、按钮去箭头改圆角居中 - 渐变actionOutlineGradient改紫蓝双色循环 - 新增健康Agent"蓝牙录入"按钮→蓝牙设备页 - "查看健康情况"改名"健康概览" - 饮食编辑框删除bug修复(控制器缓存) - 启动脚本加adb reverse自动转发 - 登录闪屏修复
50 lines
1.3 KiB
Dart
50 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../core/app_colors.dart';
|
|
import '../core/app_theme.dart';
|
|
|
|
class AppCard extends StatelessWidget {
|
|
final Widget child;
|
|
final EdgeInsetsGeometry? padding;
|
|
final EdgeInsetsGeometry? margin;
|
|
final VoidCallback? onTap;
|
|
final Color? backgroundColor;
|
|
final BorderRadius? borderRadius;
|
|
final Border? border;
|
|
|
|
const AppCard({
|
|
super.key,
|
|
required this.child,
|
|
this.padding = const EdgeInsets.all(AppTheme.sLg),
|
|
this.margin,
|
|
this.onTap,
|
|
this.backgroundColor,
|
|
this.borderRadius,
|
|
this.border,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final radius = borderRadius ?? BorderRadius.circular(AppTheme.rLg);
|
|
final card = Container(
|
|
margin:
|
|
margin ??
|
|
const EdgeInsets.symmetric(
|
|
horizontal: AppTheme.sLg,
|
|
vertical: AppTheme.sSm,
|
|
),
|
|
padding: padding,
|
|
decoration: BoxDecoration(
|
|
gradient: backgroundColor == null ? AppColors.surfaceGradient : null,
|
|
color: backgroundColor,
|
|
borderRadius: radius,
|
|
border: border ?? Border.all(color: AppColors.borderLight),
|
|
boxShadow: AppColors.cardShadowLight,
|
|
),
|
|
child: child,
|
|
);
|
|
|
|
if (onTap == null) return card;
|
|
return InkWell(onTap: onTap, borderRadius: radius, child: card);
|
|
}
|
|
}
|