fix: 欢迎卡片UI优化 + 蓝牙录入按钮 + 多处修复
- 欢迎卡片:去掉白框圆角错位、图片满宽、按钮去箭头改圆角居中 - 渐变actionOutlineGradient改紫蓝双色循环 - 新增健康Agent"蓝牙录入"按钮→蓝牙设备页 - "查看健康情况"改名"健康概览" - 饮食编辑框删除bug修复(控制器缓存) - 启动脚本加adb reverse自动转发 - 登录闪屏修复
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import '../../core/app_colors.dart';
|
||||
import '../../core/app_theme.dart';
|
||||
import '../../core/navigation_provider.dart';
|
||||
import '../../providers/auth_provider.dart';
|
||||
import '../../providers/data_providers.dart';
|
||||
@@ -243,106 +244,104 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
decoration: const BoxDecoration(gradient: AppColors.bgGradient),
|
||||
child: SafeArea(
|
||||
child: Center(
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 24),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.fromLTRB(22, 24, 22, 22),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
border: Border.all(color: AppColors.border),
|
||||
boxShadow: AppColors.cardShadow,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
_BrandMark(),
|
||||
const SizedBox(height: 16),
|
||||
const Text(
|
||||
'健康管家',
|
||||
style: TextStyle(
|
||||
fontSize: 26,
|
||||
fontWeight: FontWeight.w900,
|
||||
color: AppColors.textPrimary,
|
||||
),
|
||||
body: AppBackground(
|
||||
safeArea: true,
|
||||
child: Center(
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 24),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.fromLTRB(22, 24, 22, 22),
|
||||
decoration: BoxDecoration(
|
||||
gradient: AppColors.softGlassGradient,
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
border: Border.all(color: AppColors.borderLight),
|
||||
boxShadow: AppColors.cardShadow,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
_BrandMark(),
|
||||
const SizedBox(height: 16),
|
||||
const Text(
|
||||
'健康管家',
|
||||
style: TextStyle(
|
||||
fontSize: 26,
|
||||
fontWeight: FontWeight.w900,
|
||||
color: AppColors.textPrimary,
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Text(
|
||||
_isLogin ? '登录你的健康账户' : '创建新的健康账户',
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Text(
|
||||
_isLogin ? '登录你的健康账户' : '创建新的健康账户',
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
color: AppColors.textSecondary,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 26),
|
||||
if (_successMsg != null)
|
||||
_NoticeBanner(text: _successMsg!, success: true),
|
||||
if (!_isLogin) ...[
|
||||
_DoctorSelector(
|
||||
name: _selectedDoctorName,
|
||||
onTap: _showDoctorPicker,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
_TextField(_nameCtrl, '姓名', TextInputType.name, 20),
|
||||
const SizedBox(height: 12),
|
||||
],
|
||||
_TextField(_phoneCtrl, '手机号', TextInputType.phone, 11),
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _TextField(
|
||||
_codeCtrl,
|
||||
'验证码',
|
||||
TextInputType.number,
|
||||
6,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
_SmsButton(
|
||||
sending: _sending,
|
||||
countdown: _countdown,
|
||||
onTap: (_countdown > 0 || _sending) ? null : _sendSms,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
_Agreement(
|
||||
agreed: _agreed,
|
||||
onTap: () => setState(() => _agreed = !_agreed),
|
||||
),
|
||||
if (_error != null) ...[
|
||||
const SizedBox(height: 12),
|
||||
_NoticeBanner(text: _error!, success: false),
|
||||
],
|
||||
const SizedBox(height: 22),
|
||||
_PrimaryButton(
|
||||
loading: _loading,
|
||||
label: _isLogin ? '登录' : '注册',
|
||||
onTap: _loading ? null : _submit,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
GestureDetector(
|
||||
onTap: () => setState(() {
|
||||
_isLogin = !_isLogin;
|
||||
_error = null;
|
||||
_successMsg = null;
|
||||
}),
|
||||
child: Text(
|
||||
_isLogin ? '没有账号?去注册' : '已有账号?去登录',
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
color: AppColors.textSecondary,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.primary,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 26),
|
||||
if (_successMsg != null)
|
||||
_NoticeBanner(text: _successMsg!, success: true),
|
||||
if (!_isLogin) ...[
|
||||
_DoctorSelector(
|
||||
name: _selectedDoctorName,
|
||||
onTap: _showDoctorPicker,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
_TextField(_nameCtrl, '姓名', TextInputType.name, 20),
|
||||
const SizedBox(height: 12),
|
||||
],
|
||||
_TextField(_phoneCtrl, '手机号', TextInputType.phone, 11),
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _TextField(
|
||||
_codeCtrl,
|
||||
'验证码',
|
||||
TextInputType.number,
|
||||
6,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
_SmsButton(
|
||||
sending: _sending,
|
||||
countdown: _countdown,
|
||||
onTap: (_countdown > 0 || _sending) ? null : _sendSms,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
_Agreement(
|
||||
agreed: _agreed,
|
||||
onTap: () => setState(() => _agreed = !_agreed),
|
||||
),
|
||||
if (_error != null) ...[
|
||||
const SizedBox(height: 12),
|
||||
_NoticeBanner(text: _error!, success: false),
|
||||
],
|
||||
const SizedBox(height: 22),
|
||||
_PrimaryButton(
|
||||
loading: _loading,
|
||||
label: _isLogin ? '登录' : '注册',
|
||||
onTap: _loading ? null : _submit,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
GestureDetector(
|
||||
onTap: () => setState(() {
|
||||
_isLogin = !_isLogin;
|
||||
_error = null;
|
||||
_successMsg = null;
|
||||
}),
|
||||
child: Text(
|
||||
_isLogin ? '没有账号?去注册' : '已有账号?去登录',
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.primary,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user