Polish health app UI

This commit is contained in:
MingNian
2026-06-26 14:37:17 +08:00
parent 86c7957144
commit df37076c46
46 changed files with 717 additions and 514 deletions

View File

@@ -19,10 +19,7 @@ class SettingsPage extends ConsumerWidget {
scrolledUnderElevation: 0.5,
surfaceTintColor: Colors.transparent,
leading: IconButton(
icon: const Icon(
Icons.arrow_back,
color: AppColors.textPrimary,
),
icon: const Icon(Icons.arrow_back, color: AppColors.textPrimary),
onPressed: () => popRoute(ref),
),
title: const Text(
@@ -44,21 +41,18 @@ class SettingsPage extends ConsumerWidget {
_SettingsTile(
icon: LucideIcons.bluetooth,
title: '蓝牙设备',
colors: const [Color(0xFF38BDF8), Color(0xFF2563EB)],
onTap: () => pushRoute(ref, 'devices'),
),
const SizedBox(height: 8),
_SettingsTile(
icon: LucideIcons.bell,
title: '消息通知',
colors: const [Color(0xFFA78BFA), Color(0xFF7C3AED)],
onTap: () => pushRoute(ref, 'notificationPrefs'),
),
const SizedBox(height: 8),
_SettingsTile(
icon: LucideIcons.info,
title: '关于小脉健康',
colors: const [Color(0xFF60A5FA), Color(0xFF0891B2)],
onTap: () =>
pushRoute(ref, 'staticText', params: {'type': 'about'}),
),
@@ -66,12 +60,15 @@ class SettingsPage extends ConsumerWidget {
_SettingsTile(
icon: LucideIcons.shield,
title: '隐私协议',
colors: const [Color(0xFFF472B6), Color(0xFFDB2777)],
onTap: () => pushRoute(
ref,
'staticText',
params: {'type': 'privacy'},
),
onTap: () =>
pushRoute(ref, 'staticText', params: {'type': 'privacy'}),
),
const SizedBox(height: 8),
_SettingsTile(
icon: Icons.description_outlined,
title: '服务协议',
onTap: () =>
pushRoute(ref, 'staticText', params: {'type': 'terms'}),
),
const SizedBox(height: 24),
OutlinedButton.icon(
@@ -80,11 +77,18 @@ class SettingsPage extends ConsumerWidget {
label: const Text('删除账号'),
style: OutlinedButton.styleFrom(
foregroundColor: AppColors.error,
side: BorderSide(color: AppColors.error.withValues(alpha: 0.34)),
side: BorderSide(
color: AppColors.error.withValues(alpha: 0.34),
),
backgroundColor: Colors.white,
minimumSize: const Size.fromHeight(52),
textStyle: const TextStyle(fontSize: 16, fontWeight: FontWeight.w800),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
textStyle: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w800,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
),
),
),
const SizedBox(height: 12),
@@ -96,7 +100,10 @@ class SettingsPage extends ConsumerWidget {
backgroundColor: AppColors.error,
foregroundColor: Colors.white,
minimumSize: const Size.fromHeight(52),
textStyle: const TextStyle(fontSize: 16, fontWeight: FontWeight.w800),
textStyle: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w800,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
),
@@ -113,12 +120,20 @@ class SettingsPage extends ConsumerWidget {
final ok = await showDialog<bool>(
context: context,
builder: (ctx) => AlertDialog(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(AppTheme.rXl)),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppTheme.rXl),
),
title: const Text('删除账号', style: TextStyle(color: AppColors.error)),
content: const Text('此操作不可恢复,将删除所有健康数据、用药记录、饮食记录、报告等,确定继续?'),
actions: [
TextButton(onPressed: () => Navigator.pop(ctx, false), child: const Text('取消')),
TextButton(onPressed: () => Navigator.pop(ctx, true), child: const Text('确认删除', style: TextStyle(color: AppColors.error))),
TextButton(
onPressed: () => Navigator.pop(ctx, false),
child: const Text('取消'),
),
TextButton(
onPressed: () => Navigator.pop(ctx, true),
child: const Text('确认删除', style: TextStyle(color: AppColors.error)),
),
],
),
);
@@ -160,15 +175,11 @@ class SettingsPage extends ConsumerWidget {
class _SettingsTile extends StatelessWidget {
final IconData icon;
final String title;
final String? subtitle;
final List<Color> colors;
final VoidCallback onTap;
const _SettingsTile({
required this.icon,
required this.title,
required this.colors,
required this.onTap,
this.subtitle,
});
@override
@@ -188,32 +199,16 @@ class _SettingsTile extends StatelessWidget {
),
child: Row(
children: [
Icon(icon, color: const Color(0xFF64748B), size: 22),
Icon(icon, color: Colors.black, size: 22),
const SizedBox(width: 14),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: AppColors.textPrimary,
),
),
if (subtitle != null) ...[
const SizedBox(height: 3),
Text(
subtitle!,
style: const TextStyle(
fontSize: 12,
fontWeight: FontWeight.w500,
color: AppColors.textHint,
),
),
],
],
child: Text(
title,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: AppColors.textPrimary,
),
),
),
const Icon(