fix: 健康仪表盘单位下移 + 档案按钮浅紫 + AI问诊胶囊改名 + 删除账号功能
This commit is contained in:
@@ -302,8 +302,14 @@ class DietNotifier extends Notifier<DietState> {
|
||||
}
|
||||
|
||||
// ─────────── 饮食主题色(暖橙系,不再用紫色)───────────
|
||||
const _dietAccent = AppColors.primary;
|
||||
const _dietAccentLight = AppColors.primarySoft;
|
||||
const _dietAccent = Color(0xFFF97316);
|
||||
const _dietAccentLight = Color(0xFFFFF3E0);
|
||||
const _dietKcalText = Color(0xFF9A3412);
|
||||
const _dietGradient = LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [Color(0xFFF6D365), Color(0xFFFDA085)],
|
||||
);
|
||||
|
||||
class DietCapturePage extends ConsumerStatefulWidget {
|
||||
const DietCapturePage({super.key});
|
||||
@@ -404,11 +410,11 @@ class _DietCapturePageState extends ConsumerState<DietCapturePage> {
|
||||
('🍪', '加餐', 'snack'),
|
||||
];
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(4),
|
||||
padding: const EdgeInsets.all(6),
|
||||
decoration: BoxDecoration(
|
||||
gradient: AppColors.surfaceGradient,
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
border: Border.all(color: AppColors.borderLight),
|
||||
color: Colors.white.withValues(alpha: 0.92),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
border: Border.all(color: Colors.white, width: 1.4),
|
||||
boxShadow: AppColors.cardShadowLight,
|
||||
),
|
||||
child: Row(
|
||||
@@ -419,23 +425,28 @@ class _DietCapturePageState extends ConsumerState<DietCapturePage> {
|
||||
onTap: () => ref.read(dietProvider.notifier).setMealType(m.$3),
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
curve: Curves.easeOutCubic,
|
||||
margin: const EdgeInsets.symmetric(horizontal: 2),
|
||||
padding: const EdgeInsets.symmetric(vertical: 11),
|
||||
decoration: BoxDecoration(
|
||||
gradient: sel ? AppColors.warmCareGradient : null,
|
||||
color: sel ? null : Colors.white,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
gradient: sel ? _dietGradient : null,
|
||||
color: sel ? null : const Color(0xFFFFFBF6),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(
|
||||
color: sel ? Colors.transparent : const Color(0xFFFFE4CA),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(m.$1, style: const TextStyle(fontSize: 22)),
|
||||
const SizedBox(height: 2),
|
||||
const SizedBox.shrink(),
|
||||
const SizedBox(height: 0),
|
||||
Text(
|
||||
m.$2,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: sel ? Colors.white : AppColors.textHint,
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w900,
|
||||
color: sel ? Colors.white : _dietKcalText,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -523,7 +534,7 @@ class _DietCapturePageState extends ConsumerState<DietCapturePage> {
|
||||
vertical: 4,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.warningLight,
|
||||
color: const Color(0xFFFFF3D8),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Text(
|
||||
@@ -531,7 +542,7 @@ class _DietCapturePageState extends ConsumerState<DietCapturePage> {
|
||||
style: const TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.warning,
|
||||
color: _dietKcalText,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -645,7 +656,7 @@ class _DietCapturePageState extends ConsumerState<DietCapturePage> {
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.warning,
|
||||
color: _dietKcalText,
|
||||
),
|
||||
align: TextAlign.right,
|
||||
keyboardType: TextInputType.number,
|
||||
@@ -656,7 +667,7 @@ class _DietCapturePageState extends ConsumerState<DietCapturePage> {
|
||||
'kcal',
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: AppColors.textHint,
|
||||
color: Color(0xFFB45309),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -715,7 +726,7 @@ class _DietCapturePageState extends ConsumerState<DietCapturePage> {
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
borderSide: const BorderSide(color: AppColors.primary),
|
||||
borderSide: const BorderSide(color: _dietAccent),
|
||||
),
|
||||
hintText: hint,
|
||||
hintStyle: const TextStyle(fontSize: 14, color: AppColors.textHint),
|
||||
@@ -737,62 +748,62 @@ class _DietCapturePageState extends ConsumerState<DietCapturePage> {
|
||||
border: Border.all(color: AppColors.border),
|
||||
boxShadow: AppColors.cardShadowLight,
|
||||
),
|
||||
child: Row(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 56,
|
||||
height: 56,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 56,
|
||||
height: 56,
|
||||
child: CircularProgressIndicator(
|
||||
value: (totalCal / 700).clamp(0.0, 1.0),
|
||||
strokeWidth: 4,
|
||||
backgroundColor: AppColors.borderLight,
|
||||
color: _dietAccent,
|
||||
),
|
||||
),
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
const Text(
|
||||
'本餐热量',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w800,
|
||||
color: AppColors.textPrimary,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 56,
|
||||
height: 56,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'$totalCal',
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w800,
|
||||
SizedBox(
|
||||
width: 56,
|
||||
height: 56,
|
||||
child: CircularProgressIndicator(
|
||||
value: (totalCal / 700).clamp(0.0, 1.0),
|
||||
strokeWidth: 4,
|
||||
backgroundColor: AppColors.borderLight,
|
||||
color: _dietAccent,
|
||||
),
|
||||
),
|
||||
const Text(
|
||||
'kcal',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: AppColors.textSecondary,
|
||||
),
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
'$totalCal',
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w800,
|
||||
color: _dietAccent,
|
||||
),
|
||||
),
|
||||
const Text(
|
||||
'kcal',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: AppColors.textSecondary,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'本餐热量',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.textPrimary,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Row(
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Row(
|
||||
children: [
|
||||
_macro('碳水', 0.55, const Color(0xFFF5A623)),
|
||||
const SizedBox(width: 8),
|
||||
@@ -801,8 +812,8 @@ class _DietCapturePageState extends ConsumerState<DietCapturePage> {
|
||||
_macro('脂肪', 0.20, const Color(0xFFE8686A)),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -855,28 +866,46 @@ class _DietCapturePageState extends ConsumerState<DietCapturePage> {
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: AppColors.border),
|
||||
),
|
||||
child: Row(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: 36,
|
||||
height: 36,
|
||||
decoration: BoxDecoration(
|
||||
color: _dietAccentLight,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
const Text(
|
||||
'AI建议',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w800,
|
||||
color: AppColors.textPrimary,
|
||||
),
|
||||
child: const Icon(Icons.auto_awesome, size: 20, color: _dietAccent),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Text(
|
||||
text,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
color: AppColors.textPrimary,
|
||||
height: 1.6,
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: 36,
|
||||
height: 36,
|
||||
decoration: BoxDecoration(
|
||||
color: _dietAccentLight,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.auto_awesome,
|
||||
size: 20,
|
||||
color: _dietAccent,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Text(
|
||||
text,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
color: AppColors.textPrimary,
|
||||
height: 1.6,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -889,9 +918,15 @@ class _DietCapturePageState extends ConsumerState<DietCapturePage> {
|
||||
width: double.infinity,
|
||||
height: 52,
|
||||
decoration: BoxDecoration(
|
||||
gradient: AppColors.warmCareGradient,
|
||||
gradient: _dietGradient,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: AppColors.buttonShadow,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: _dietAccent.withValues(alpha: 0.24),
|
||||
blurRadius: 16,
|
||||
offset: const Offset(0, 8),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
|
||||
Reference in New Issue
Block a user