- 饮食: 新增 DietCommentaryPolicy + diet_record_logic, 饮食记录逻辑抽取复用 - 通知管理: 分隔线改为仿通知中心样式, 跳过图标区域只留文字下方 - 侧边栏: 对话记录操作栏浮层修复 + 常用功能间距收紧 - 智能体: 欢迎卡片去 400ms 延迟 + 胶囊去阴影 - 后端: AI 会话仓库新增方法 + 饮食评论策略 + 健康记录规则调整 - 其他: api_client IP 适配 + 多页面 UI 微调 + 新增测试
66 lines
1.8 KiB
Dart
66 lines
1.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../core/app_colors.dart';
|
|
import 'app_gradient_widgets.dart';
|
|
|
|
class AppEmptyState extends StatelessWidget {
|
|
final IconData icon;
|
|
final String title;
|
|
final String? subtitle;
|
|
final Widget? action;
|
|
|
|
const AppEmptyState({
|
|
super.key,
|
|
required this.icon,
|
|
required this.title,
|
|
this.subtitle,
|
|
this.action,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Center(
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(48),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Container(
|
|
width: 80,
|
|
height: 80,
|
|
decoration: BoxDecoration(
|
|
gradient: AppColors.softGlassGradient,
|
|
borderRadius: BorderRadius.circular(40),
|
|
border: Border.all(color: AppColors.borderLight),
|
|
boxShadow: AppColors.cardShadowLight,
|
|
),
|
|
child: AppGradientIcon(icon: icon, size: 34),
|
|
),
|
|
const SizedBox(height: 18),
|
|
Text(
|
|
title,
|
|
style: const TextStyle(
|
|
fontSize: 18,
|
|
fontWeight: FontWeight.w700,
|
|
color: AppColors.textPrimary,
|
|
),
|
|
textAlign: TextAlign.center,
|
|
),
|
|
if (subtitle != null) ...[
|
|
const SizedBox(height: 6),
|
|
Text(
|
|
subtitle!,
|
|
style: const TextStyle(
|
|
fontSize: 14,
|
|
color: AppColors.textSecondary,
|
|
),
|
|
textAlign: TextAlign.center,
|
|
),
|
|
],
|
|
if (action != null) ...[const SizedBox(height: 20), action!],
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|