- 登录页:输入框白底+渐变紫蓝外框,去掉focus内框;登录按钮白底紫字;协议勾选白底 - 首页胶囊:适老化加大(内边距14x8/字号15/图标17/圆角18) - 欢迎卡片底部提示:各智能体专属引导文案,字号加大颜色加深 - 今日健康卡片:健康指标改一行总结(异常提醒/正常显示);用药显示具体药品名+状态 - 发送按钮:蓝→紫渐变 - 设置页菜单:白色卡片+圆角16+轻阴影 - IP改localhost:adb reverse解决IP变动问题 - 服药打卡快捷按钮:改为跳转打卡页,不再一键全打
69 lines
2.3 KiB
Dart
69 lines
2.3 KiB
Dart
import 'package:flutter/material.dart';
|
||
import 'package:shadcn_ui/shadcn_ui.dart';
|
||
import '../core/app_colors.dart';
|
||
import '../core/app_theme.dart';
|
||
|
||
/// 统一菜单项,profile_page 和 settings_pages 都共用这个
|
||
class AppMenuItem extends StatelessWidget {
|
||
final IconData icon;
|
||
final String title;
|
||
final String? subtitle;
|
||
final String? trailing;
|
||
final VoidCallback? onTap;
|
||
|
||
const AppMenuItem({
|
||
super.key,
|
||
required this.icon,
|
||
required this.title,
|
||
this.subtitle,
|
||
this.trailing,
|
||
this.onTap,
|
||
});
|
||
|
||
@override
|
||
Widget build(BuildContext context) {
|
||
return GestureDetector(
|
||
onTap: onTap,
|
||
behavior: HitTestBehavior.opaque,
|
||
child: Container(
|
||
margin: const EdgeInsets.symmetric(horizontal: 24, vertical: 4),
|
||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
||
decoration: BoxDecoration(
|
||
color: Colors.white,
|
||
borderRadius: BorderRadius.circular(16),
|
||
boxShadow: [BoxShadow(color: Colors.black.withAlpha(6), blurRadius: 8, offset: const Offset(0, 2))],
|
||
),
|
||
child: Row(children: [
|
||
Container(
|
||
width: 40,
|
||
height: 40,
|
||
decoration: BoxDecoration(
|
||
color: AppColors.cardInner,
|
||
borderRadius: BorderRadius.circular(12),
|
||
),
|
||
child: Icon(icon, size: 22, color: AppColors.textPrimary),
|
||
),
|
||
const SizedBox(width: 14),
|
||
Expanded(
|
||
child: Column(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
children: [
|
||
Text(title, style: const TextStyle(fontSize: 17, fontWeight: FontWeight.w500, color: AppColors.textPrimary)),
|
||
if (subtitle != null && subtitle!.isNotEmpty)
|
||
Padding(
|
||
padding: const EdgeInsets.only(top: 2),
|
||
child: Text(subtitle!, style: const TextStyle(fontSize: 14, color: AppColors.textHint)),
|
||
),
|
||
],
|
||
),
|
||
),
|
||
if (trailing != null && trailing!.isNotEmpty)
|
||
Text(trailing!, style: const TextStyle(fontSize: 15, color: AppColors.textHint)),
|
||
const SizedBox(width: 4),
|
||
const Icon(Icons.chevron_right, size: 20, color: AppColors.textHint),
|
||
]),
|
||
),
|
||
);
|
||
}
|
||
}
|