Polish health app UI
This commit is contained in:
@@ -12,8 +12,7 @@ class LoginPage extends ConsumerStatefulWidget {
|
||||
}
|
||||
|
||||
class _LoginPageState extends ConsumerState<LoginPage> {
|
||||
static const _headerBg = 'assets/branding/ui_abstract_header_bg_v1.png';
|
||||
static const _cornerAccent = 'assets/branding/ui_corner_accent_v1.png';
|
||||
static const _loginBg = 'assets/branding/login_background_v1.png';
|
||||
|
||||
final _phoneCtrl = TextEditingController();
|
||||
final _codeCtrl = TextEditingController();
|
||||
@@ -66,8 +65,12 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
||||
|
||||
Future<void> _submit() async {
|
||||
if (!_agreed) {
|
||||
setState(() => _error = '请阅读并同意服务协议和隐私政策');
|
||||
return;
|
||||
final accepted = await _showAgreementDialog();
|
||||
if (!mounted || accepted != true) return;
|
||||
setState(() {
|
||||
_agreed = true;
|
||||
_error = null;
|
||||
});
|
||||
}
|
||||
if (_phoneCtrl.text.trim().isEmpty || _codeCtrl.text.trim().isEmpty) {
|
||||
setState(() => _error = '请输入手机号和验证码');
|
||||
@@ -132,6 +135,124 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool?> _showAgreementDialog() {
|
||||
return showDialog<bool>(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
barrierColor: Colors.black.withValues(alpha: 0.54),
|
||||
builder: (ctx) => Dialog(
|
||||
insetPadding: const EdgeInsets.symmetric(horizontal: 28),
|
||||
backgroundColor: Colors.transparent,
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
constraints: const BoxConstraints(maxWidth: 380),
|
||||
padding: const EdgeInsets.fromLTRB(22, 28, 22, 22),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(28),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withValues(alpha: 0.14),
|
||||
blurRadius: 34,
|
||||
offset: const Offset(0, 18),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text(
|
||||
'服务协议及隐私保护',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 21,
|
||||
fontWeight: FontWeight.w900,
|
||||
color: AppColors.textPrimary,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 18),
|
||||
RichText(
|
||||
textAlign: TextAlign.center,
|
||||
text: const TextSpan(
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
height: 1.55,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.textSecondary,
|
||||
),
|
||||
children: [
|
||||
TextSpan(text: '请阅读并同意'),
|
||||
TextSpan(
|
||||
text: '《服务协议》',
|
||||
style: TextStyle(color: AppColors.primary),
|
||||
),
|
||||
TextSpan(text: '和'),
|
||||
TextSpan(
|
||||
text: '《隐私政策》',
|
||||
style: TextStyle(color: AppColors.primary),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 26),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: SizedBox(
|
||||
height: 50,
|
||||
child: OutlinedButton(
|
||||
onPressed: () => Navigator.pop(ctx, false),
|
||||
style: OutlinedButton.styleFrom(
|
||||
foregroundColor: AppColors.primary,
|
||||
side: BorderSide(
|
||||
color: AppColors.primary.withValues(alpha: 0.62),
|
||||
width: 1.2,
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
),
|
||||
textStyle: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w800,
|
||||
),
|
||||
),
|
||||
child: const Text('不同意'),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: GestureDetector(
|
||||
onTap: () => Navigator.pop(ctx, true),
|
||||
child: Container(
|
||||
height: 50,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
gradient: AppColors.doctorGradient,
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
boxShadow: AppColors.buttonShadow,
|
||||
),
|
||||
child: const Text(
|
||||
'同意',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w900,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _goHome() {
|
||||
ref.invalidate(latestHealthProvider);
|
||||
ref.invalidate(medicationListProvider);
|
||||
@@ -250,34 +371,26 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
||||
backgroundColor: Colors.white,
|
||||
body: Stack(
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: Image.asset(
|
||||
_loginBg,
|
||||
fit: BoxFit.cover,
|
||||
alignment: Alignment.topCenter,
|
||||
),
|
||||
),
|
||||
Positioned.fill(
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(gradient: AppColors.bgGradient),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
height: 260,
|
||||
child: Opacity(
|
||||
opacity: 0.92,
|
||||
child: Image.asset(
|
||||
_headerBg,
|
||||
fit: BoxFit.cover,
|
||||
alignment: Alignment.topCenter,
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 18,
|
||||
right: -44,
|
||||
width: 180,
|
||||
height: 180,
|
||||
child: IgnorePointer(
|
||||
child: Opacity(
|
||||
opacity: 0.86,
|
||||
child: Image.asset(_cornerAccent, fit: BoxFit.contain),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
Colors.white.withValues(alpha: 0.10),
|
||||
Colors.white.withValues(alpha: 0.28),
|
||||
Colors.white.withValues(alpha: 0.54),
|
||||
],
|
||||
stops: const [0.0, 0.52, 1.0],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -285,10 +398,13 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
return SingleChildScrollView(
|
||||
padding: const EdgeInsets.fromLTRB(20, 22, 20, 24),
|
||||
padding: const EdgeInsets.fromLTRB(20, 28, 20, 24),
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
minHeight: constraints.maxHeight - 46,
|
||||
minHeight: (constraints.maxHeight - 52).clamp(
|
||||
0.0,
|
||||
double.infinity,
|
||||
),
|
||||
),
|
||||
child: Center(
|
||||
child: ConstrainedBox(
|
||||
@@ -297,8 +413,8 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
_LoginHero(isLogin: _isLogin),
|
||||
const SizedBox(height: 22),
|
||||
const _LoginHero(),
|
||||
const SizedBox(height: 28),
|
||||
_LoginFormCard(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
@@ -328,7 +444,8 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
||||
'手机号',
|
||||
TextInputType.phone,
|
||||
11,
|
||||
icon: Icons.phone_iphone_rounded,
|
||||
icon: Icons.local_phone_rounded,
|
||||
gradientIcon: true,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
@@ -339,7 +456,8 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
||||
'验证码',
|
||||
TextInputType.number,
|
||||
6,
|
||||
icon: Icons.verified_outlined,
|
||||
icon: Icons.sms_rounded,
|
||||
gradientIcon: true,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
@@ -407,9 +525,7 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
||||
}
|
||||
|
||||
class _LoginHero extends StatelessWidget {
|
||||
final bool isLogin;
|
||||
|
||||
const _LoginHero({required this.isLogin});
|
||||
const _LoginHero();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -437,23 +553,6 @@ class _LoginHero extends StatelessWidget {
|
||||
color: AppColors.textSecondary,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 7),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withValues(alpha: 0.76),
|
||||
borderRadius: BorderRadius.circular(999),
|
||||
border: Border.all(color: AppColors.borderLight),
|
||||
),
|
||||
child: Text(
|
||||
isLogin ? '登录你的健康账户' : '创建新的健康账户',
|
||||
style: const TextStyle(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w800,
|
||||
color: AppColors.textPrimary,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -488,18 +587,15 @@ class _LoginFormCard extends StatelessWidget {
|
||||
class _BrandMark extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: 72,
|
||||
height: 72,
|
||||
decoration: BoxDecoration(
|
||||
gradient: AppColors.primaryGradient,
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
boxShadow: AppColors.buttonShadow,
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.monitor_heart_outlined,
|
||||
color: Colors.white,
|
||||
size: 34,
|
||||
return SizedBox(
|
||||
width: 132,
|
||||
height: 132,
|
||||
child: Transform.scale(
|
||||
scale: 1.08,
|
||||
child: Image.asset(
|
||||
'assets/branding/health_icon_master.png',
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -511,8 +607,16 @@ class _TextField extends StatelessWidget {
|
||||
final TextInputType type;
|
||||
final int maxLen;
|
||||
final IconData? icon;
|
||||
final bool gradientIcon;
|
||||
|
||||
const _TextField(this.ctrl, this.hint, this.type, this.maxLen, {this.icon});
|
||||
const _TextField(
|
||||
this.ctrl,
|
||||
this.hint,
|
||||
this.type,
|
||||
this.maxLen, {
|
||||
this.icon,
|
||||
this.gradientIcon = false,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => TextField(
|
||||
@@ -529,6 +633,8 @@ class _TextField extends StatelessWidget {
|
||||
counterText: '',
|
||||
prefixIcon: icon == null
|
||||
? null
|
||||
: gradientIcon
|
||||
? _GradientPrefixIcon(icon: icon!)
|
||||
: Icon(icon, size: 20, color: AppColors.textSecondary),
|
||||
filled: true,
|
||||
fillColor: const Color(0xFFF8FAFC),
|
||||
@@ -545,6 +651,20 @@ class _TextField extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
class _GradientPrefixIcon extends StatelessWidget {
|
||||
final IconData icon;
|
||||
const _GradientPrefixIcon({required this.icon});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ShaderMask(
|
||||
shaderCallback: AppColors.doctorGradient.createShader,
|
||||
blendMode: BlendMode.srcIn,
|
||||
child: Icon(icon, size: 23, color: Colors.white),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _DoctorSelector extends StatelessWidget {
|
||||
final String? name;
|
||||
final VoidCallback onTap;
|
||||
@@ -762,7 +882,7 @@ class _PrimaryButton extends StatelessWidget {
|
||||
height: 52,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
gradient: AppColors.primaryGradient,
|
||||
gradient: AppColors.doctorGradient,
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
boxShadow: AppColors.buttonShadow,
|
||||
),
|
||||
|
||||
@@ -3,7 +3,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
|
||||
import '../../core/app_colors.dart';
|
||||
import '../../core/app_theme.dart';
|
||||
import '../../core/navigation_provider.dart';
|
||||
import '../../providers/data_providers.dart';
|
||||
import '../../services/in_app_notification_service.dart';
|
||||
@@ -147,7 +146,7 @@ class _NotificationCenterPageState
|
||||
final unread = _history?.unreadCount ?? 0;
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFFF8FAFF),
|
||||
backgroundColor: Colors.white,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.white,
|
||||
elevation: 0,
|
||||
@@ -248,19 +247,19 @@ class _NotificationCenterPageState
|
||||
|
||||
return ListView(
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
padding: const EdgeInsets.fromLTRB(16, 12, 16, 32),
|
||||
padding: const EdgeInsets.fromLTRB(16, 14, 16, 32),
|
||||
children: [
|
||||
if (unread > 0) _UnreadHint(unreadCount: unread),
|
||||
const SizedBox(height: 8),
|
||||
if (today.isNotEmpty) ...[
|
||||
const _SectionTitle('今天'),
|
||||
const SizedBox(height: 8),
|
||||
const SizedBox(height: 10),
|
||||
...today.map(_buildDismissible),
|
||||
],
|
||||
if (earlier.isNotEmpty) ...[
|
||||
if (today.isNotEmpty) const SizedBox(height: 14),
|
||||
if (today.isNotEmpty) const SizedBox(height: 18),
|
||||
const _SectionTitle('更早'),
|
||||
const SizedBox(height: 8),
|
||||
const SizedBox(height: 10),
|
||||
...earlier.map(_buildDismissible),
|
||||
],
|
||||
],
|
||||
@@ -268,7 +267,7 @@ class _NotificationCenterPageState
|
||||
}
|
||||
|
||||
Widget _buildDismissible(InAppNotification item) => Padding(
|
||||
padding: const EdgeInsets.only(bottom: 10),
|
||||
padding: const EdgeInsets.only(bottom: 12),
|
||||
child: Dismissible(
|
||||
key: ValueKey(item.id),
|
||||
direction: DismissDirection.endToStart,
|
||||
@@ -281,7 +280,7 @@ class _NotificationCenterPageState
|
||||
end: Alignment.centerRight,
|
||||
colors: [AppColors.error.withValues(alpha: 0.6), AppColors.error],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
borderRadius: BorderRadius.circular(28),
|
||||
),
|
||||
child: const Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
@@ -312,15 +311,21 @@ class _UnreadHint extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 8),
|
||||
return Container(
|
||||
margin: const EdgeInsets.fromLTRB(0, 4, 0, 12),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFFFFBEB),
|
||||
borderRadius: BorderRadius.circular(999),
|
||||
border: Border.all(color: const Color(0xFFFDE68A)),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 6,
|
||||
height: 6,
|
||||
width: 8,
|
||||
height: 8,
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFFEF4444),
|
||||
color: Color(0xFFF97316),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
@@ -329,8 +334,8 @@ class _UnreadHint extends StatelessWidget {
|
||||
'你有 $unreadCount 条未读消息',
|
||||
style: const TextStyle(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.textSecondary,
|
||||
fontWeight: FontWeight.w800,
|
||||
color: Color(0xFF92400E),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -344,15 +349,21 @@ class _SectionTitle extends StatelessWidget {
|
||||
const _SectionTitle(this.text);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => Padding(
|
||||
padding: const EdgeInsets.fromLTRB(2, 12, 2, 6),
|
||||
Widget build(BuildContext context) => Container(
|
||||
margin: const EdgeInsets.fromLTRB(0, 12, 0, 2),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFF8FAFC),
|
||||
borderRadius: BorderRadius.circular(999),
|
||||
border: Border.all(color: const Color(0xFFE5E7EB)),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 4,
|
||||
height: 16,
|
||||
width: 8,
|
||||
height: 8,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.primary,
|
||||
gradient: AppColors.doctorGradient,
|
||||
borderRadius: BorderRadius.circular(99),
|
||||
),
|
||||
),
|
||||
@@ -366,8 +377,18 @@ class _SectionTitle extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
const Expanded(
|
||||
child: Divider(height: 1, thickness: 1, color: AppColors.divider),
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 1,
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
const Color(0xFFE5E7EB),
|
||||
const Color(0xFFE5E7EB).withValues(alpha: 0),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -385,26 +406,32 @@ class _NotificationCard extends StatelessWidget {
|
||||
final visual = _NotificationVisual.of(item);
|
||||
return Material(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
borderRadius: BorderRadius.circular(28),
|
||||
elevation: 0,
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
borderRadius: BorderRadius.circular(28),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 13),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
borderRadius: BorderRadius.circular(28),
|
||||
border: Border.all(
|
||||
color: item.isRead
|
||||
? AppColors.border
|
||||
: visual.color.withValues(alpha: 0.34),
|
||||
width: item.isRead ? 1 : 1.2,
|
||||
? const Color(0xFFF1F5F9)
|
||||
: visual.color.withValues(alpha: 0.24),
|
||||
width: 1,
|
||||
),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: const Color(0xFF101828).withValues(alpha: 0.03),
|
||||
blurRadius: 8,
|
||||
offset: const Offset(0, 2),
|
||||
color: const Color(0xFF0F172A).withValues(alpha: 0.08),
|
||||
blurRadius: 22,
|
||||
offset: const Offset(0, 10),
|
||||
),
|
||||
BoxShadow(
|
||||
color: visual.color.withValues(alpha: item.isRead ? 0 : 0.08),
|
||||
blurRadius: 18,
|
||||
offset: const Offset(0, 8),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -416,21 +443,24 @@ class _NotificationCard extends StatelessWidget {
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
Container(
|
||||
width: 44,
|
||||
height: 44,
|
||||
width: 48,
|
||||
height: 48,
|
||||
decoration: BoxDecoration(
|
||||
color: visual.lightColor,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
border: Border.all(
|
||||
color: visual.color.withValues(alpha: 0.12),
|
||||
),
|
||||
),
|
||||
child: Icon(visual.icon, size: 22, color: visual.color),
|
||||
child: Icon(visual.icon, size: 23, color: visual.color),
|
||||
),
|
||||
if (!item.isRead)
|
||||
Positioned(
|
||||
top: -2,
|
||||
right: -2,
|
||||
child: Container(
|
||||
width: 9,
|
||||
height: 9,
|
||||
width: 10,
|
||||
height: 10,
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFEF4444),
|
||||
shape: BoxShape.circle,
|
||||
@@ -440,7 +470,7 @@ class _NotificationCard extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
const SizedBox(width: 13),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -463,25 +493,36 @@ class _NotificationCard extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
_formatTime(item.createdAt),
|
||||
style: const TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.textSecondary,
|
||||
const SizedBox(width: 8),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 4,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFF8FAFC),
|
||||
borderRadius: BorderRadius.circular(999),
|
||||
),
|
||||
child: Text(
|
||||
_formatTime(item.createdAt),
|
||||
style: const TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.textSecondary,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
const SizedBox(height: 6),
|
||||
Text(
|
||||
item.message,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
height: 1.45,
|
||||
height: 1.5,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.textSecondary,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -2885,6 +2885,44 @@ class StaticTextPage extends ConsumerWidget {
|
||||
### 六、联系我们
|
||||
如有任何关于隐私的问题,请联系:
|
||||
邮箱:privacy@healthbutler.com
|
||||
电话:400-xxx-xxxx''',
|
||||
'terms': '''## 服务协议
|
||||
|
||||
更新日期:2026年6月26日
|
||||
|
||||
欢迎使用小脉健康。请您在注册、登录和使用本应用前,仔细阅读并理解本服务协议。您点击同意或继续使用本应用,即表示您已阅读、理解并同意本协议。
|
||||
|
||||
### 一、服务内容
|
||||
小脉健康为用户提供健康数据记录、用药管理、报告管理、运动计划、健康日历、AI 健康建议及在线医生咨询等功能。具体服务内容会根据产品版本和实际开通情况进行调整。
|
||||
|
||||
### 二、账号使用
|
||||
- 您应使用真实、准确、有效的信息完成注册和登录。
|
||||
- 您应妥善保管账号、验证码及设备信息,不得将账号转让、出租或出借给他人使用。
|
||||
- 因您主动泄露账号信息或操作不当造成的损失,由您自行承担。
|
||||
|
||||
### 三、健康服务说明
|
||||
- 本应用提供的 AI 分析、健康提醒和运动饮食建议仅作为健康管理参考,不替代医生面对面的诊断、治疗或处方。
|
||||
- 如您出现胸痛、呼吸困难、意识异常、严重头痛等紧急情况,应立即拨打急救电话或前往医疗机构就诊。
|
||||
- 医生咨询、报告解读等内容应结合您的实际病史、检查结果和线下诊疗意见综合判断。
|
||||
|
||||
### 四、用户行为规范
|
||||
您在使用本应用时不得:
|
||||
- 提交虚假、违法、侵权或误导性信息;
|
||||
- 干扰应用正常运行,或尝试未经授权访问系统、数据和接口;
|
||||
- 利用本应用从事违法违规、损害他人权益或扰乱医疗服务秩序的行为。
|
||||
|
||||
### 五、数据与隐私
|
||||
我们会按照《隐私政策》收集、使用、存储和保护您的个人信息及健康数据。您可在 App 内「设置」中查看隐私政策,并依法行使查询、更正、删除和注销账号等权利。
|
||||
|
||||
### 六、服务变更与中止
|
||||
为提升服务质量或满足合规要求,我们可能对功能、页面、规则或服务范围进行调整。若因维护、升级、网络故障、不可抗力或法律法规要求导致服务暂时中断,我们会尽力降低对您的影响。
|
||||
|
||||
### 七、责任限制
|
||||
在法律允许范围内,小脉健康不对因第三方服务、网络故障、设备异常、用户误操作或不可抗力造成的服务中断、数据延迟或损失承担超出法定范围的责任。
|
||||
|
||||
### 八、联系我们
|
||||
如您对本协议或服务使用有任何疑问,请通过以下方式联系我们:
|
||||
邮箱:support@healthbutler.com
|
||||
电话:400-xxx-xxxx''',
|
||||
'about': '''## 关于小脉健康
|
||||
|
||||
@@ -2914,56 +2952,76 @@ class StaticTextPage extends ConsumerWidget {
|
||||
© 2025-2026 小脉健康团队。保留所有权利。
|
||||
本软件受中华人民共和国著作权法保护。''',
|
||||
};
|
||||
return GradientScaffold(
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.white,
|
||||
elevation: 0,
|
||||
scrolledUnderElevation: 0.5,
|
||||
surfaceTintColor: Colors.transparent,
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.chevron_left),
|
||||
icon: const Icon(Icons.chevron_left, color: AppColors.textPrimary),
|
||||
onPressed: () => popRoute(ref),
|
||||
),
|
||||
title: Text(
|
||||
titles[type] ?? '',
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
fontSize: 19,
|
||||
color: AppColors.textPrimary,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontWeight: FontWeight.w800,
|
||||
),
|
||||
),
|
||||
centerTitle: true,
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: MarkdownBody(
|
||||
data: contents[type] ?? '内容加载中...',
|
||||
selectable: true,
|
||||
styleSheet: MarkdownStyleSheet(
|
||||
p: const TextStyle(
|
||||
fontSize: 17,
|
||||
height: 1.8,
|
||||
color: AppColors.textPrimary,
|
||||
),
|
||||
h1: const TextStyle(
|
||||
fontSize: 22,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.textPrimary,
|
||||
height: 1.5,
|
||||
),
|
||||
h2: const TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.textPrimary,
|
||||
height: 1.5,
|
||||
),
|
||||
h3: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.textPrimary,
|
||||
height: 1.5,
|
||||
),
|
||||
listBullet: const TextStyle(
|
||||
fontSize: 17,
|
||||
height: 1.8,
|
||||
color: AppColors.textPrimary,
|
||||
padding: const EdgeInsets.fromLTRB(22, 18, 22, 36),
|
||||
child: Center(
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 680),
|
||||
child: MarkdownBody(
|
||||
data: contents[type] ?? '内容加载中...',
|
||||
selectable: true,
|
||||
styleSheet: MarkdownStyleSheet(
|
||||
textAlign: WrapAlignment.start,
|
||||
p: const TextStyle(
|
||||
fontSize: 15,
|
||||
height: 1.85,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.textPrimary,
|
||||
),
|
||||
h1Align: WrapAlignment.center,
|
||||
h1Padding: const EdgeInsets.only(bottom: 18),
|
||||
h1: const TextStyle(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.w900,
|
||||
color: AppColors.textPrimary,
|
||||
height: 1.35,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
h2Padding: const EdgeInsets.only(top: 18, bottom: 8),
|
||||
h2: const TextStyle(
|
||||
fontSize: 19,
|
||||
fontWeight: FontWeight.w900,
|
||||
color: AppColors.textPrimary,
|
||||
height: 1.45,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
h3Padding: const EdgeInsets.only(top: 16, bottom: 6),
|
||||
h3: const TextStyle(
|
||||
fontSize: 17,
|
||||
fontWeight: FontWeight.w800,
|
||||
color: AppColors.textPrimary,
|
||||
height: 1.45,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
listBullet: const TextStyle(
|
||||
fontSize: 15,
|
||||
height: 1.85,
|
||||
color: AppColors.textPrimary,
|
||||
),
|
||||
blockSpacing: 10,
|
||||
listIndent: 22,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user