feat: align iOS client safety and consent experience

This commit is contained in:
MingNian
2026-07-29 13:30:34 +08:00
parent 3b5cec10a6
commit 01f4955e0e
11 changed files with 290 additions and 374 deletions

View File

@@ -1,5 +1,3 @@
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:shadcn_ui/shadcn_ui.dart';
@@ -328,82 +326,55 @@ class _MetricTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
final elderMode = ElderModeScope.enabledOf(context);
final height = elderMode ? 112.0 : 100.0;
return ClipRRect(
return InkWell(
onTap: onTap,
borderRadius: BorderRadius.circular(18),
child: BackdropFilter(
filter: ui.ImageFilter.blur(sigmaX: 10, sigmaY: 10),
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: onTap,
child: Container(
height: height,
padding: const EdgeInsets.symmetric(horizontal: 2, vertical: 7),
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Colors.white.withValues(alpha: 0.62),
Colors.white.withValues(alpha: 0.42),
const Color(0xFFD9FCFF).withValues(alpha: 0.34),
],
child: Container(
height: elderMode ? 108 : 100,
padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 10),
decoration: BoxDecoration(
color: Colors.white.withValues(alpha: 0.22),
borderRadius: BorderRadius.circular(18),
border: Border.all(color: Colors.white.withValues(alpha: 0.40)),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
height: 32,
child: FittedBox(
fit: BoxFit.scaleDown,
child: Text(
info.value,
maxLines: 1,
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 26,
fontWeight: FontWeight.w700,
color: Colors.white,
),
),
borderRadius: BorderRadius.circular(18),
border: Border.all(
color: Colors.white.withValues(alpha: 0.82),
width: 1.2,
),
boxShadow: [
BoxShadow(
color: const Color(0xFF0369A1).withValues(alpha: 0.10),
blurRadius: 10,
offset: const Offset(0, 4),
),
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
height: 32,
child: FittedBox(
fit: BoxFit.scaleDown,
child: Text(
info.value,
maxLines: 1,
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 23,
fontWeight: FontWeight.w800,
color: Colors.white,
),
),
),
),
if (info.unit != null)
Text(
info.unit!,
style: const TextStyle(
fontSize: 13,
fontWeight: FontWeight.w600,
color: Color(0xE8FFFFFF),
),
),
const SizedBox(height: 2),
Text(
info.label,
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.w700,
color: Colors.white,
),
),
],
),
),
),
if (info.unit != null)
Text(
info.unit!,
style: const TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xE0FFFFFF),
),
),
const SizedBox(height: 2),
Text(
info.label,
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: Colors.white,
),
),
],
),
),
);
@@ -460,12 +431,6 @@ class _NavigationSection extends StatelessWidget {
route: 'exercisePlan',
colors: AppColors.exerciseGradient.colors,
),
_NavItem(
icon: LucideIcons.bluetooth,
title: '设备',
route: 'devices',
colors: AppColors.deviceGradient.colors,
),
];
return _LightSection(
@@ -742,43 +707,9 @@ class _HealthDashboardBackgroundPainter extends CustomPainter {
..shader = const LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [Color(0xFF4FACFE), Color(0xFF00F2FE)],
colors: [Color(0xFF00C6FB), Color(0xFF005BEA)],
).createShader(rect);
canvas.drawRect(rect, paint);
final glow = Paint()
..shader =
RadialGradient(
colors: [
Colors.white.withValues(alpha: 0.32),
Colors.white.withValues(alpha: 0),
],
).createShader(
Rect.fromCircle(
center: Offset(size.width * 0.12, size.height * 0.05),
radius: size.width * 0.7,
),
);
canvas.drawCircle(
Offset(size.width * 0.12, size.height * 0.05),
size.width * 0.7,
glow,
);
final highlight = Paint()
..color = Colors.white.withValues(alpha: 0.20)
..style = PaintingStyle.stroke
..strokeWidth = 1.2;
canvas.drawLine(
Offset(size.width * 0.52, -12),
Offset(size.width * 0.16, size.height + 18),
highlight,
);
canvas.drawLine(
Offset(size.width * 0.96, -10),
Offset(size.width * 0.58, size.height + 22),
highlight,
);
}
@override