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/omron_device_provider.dart';
|
||||
|
||||
@@ -88,8 +89,7 @@ class _DeviceManagementPageState extends ConsumerState<DeviceManagementPage> {
|
||||
Widget build(BuildContext context) {
|
||||
final device = ref.watch(omronDeviceProvider);
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.background,
|
||||
return GradientScaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('蓝牙设备'),
|
||||
leading: IconButton(
|
||||
@@ -118,14 +118,15 @@ class _DeviceManagementPageState extends ConsumerState<DeviceManagementPage> {
|
||||
width: 82,
|
||||
height: 82,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.iconBg,
|
||||
gradient: AppColors.calmHealthGradient,
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
border: Border.all(color: AppColors.border),
|
||||
border: Border.all(color: AppColors.borderLight),
|
||||
boxShadow: AppColors.cardShadowLight,
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.bluetooth_disabled,
|
||||
size: 40,
|
||||
color: AppColors.primary,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
@@ -156,10 +157,10 @@ class _DeviceManagementPageState extends ConsumerState<DeviceManagementPage> {
|
||||
duration: const Duration(milliseconds: 250),
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
gradient: AppColors.surfaceGradient,
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
border: Border.all(
|
||||
color: d.isConnected ? AppColors.success : AppColors.border,
|
||||
color: d.isConnected ? AppColors.success : AppColors.borderLight,
|
||||
),
|
||||
boxShadow: AppColors.cardShadowLight,
|
||||
),
|
||||
@@ -169,15 +170,16 @@ class _DeviceManagementPageState extends ConsumerState<DeviceManagementPage> {
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: BoxDecoration(
|
||||
color: d.isConnected
|
||||
? AppColors.successLight
|
||||
: AppColors.cardInner,
|
||||
gradient: d.isConnected
|
||||
? AppColors.calmHealthGradient
|
||||
: AppColors.surfaceGradient,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
border: Border.all(color: AppColors.borderLight),
|
||||
),
|
||||
child: Icon(
|
||||
Icons.bluetooth,
|
||||
size: 24,
|
||||
color: d.isConnected ? AppColors.success : AppColors.textHint,
|
||||
color: d.isConnected ? Colors.white : AppColors.textHint,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 14),
|
||||
@@ -250,9 +252,9 @@ class _DeviceManagementPageState extends ConsumerState<DeviceManagementPage> {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
gradient: AppColors.surfaceGradient,
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
border: Border.all(color: AppColors.border),
|
||||
border: Border.all(color: AppColors.borderLight),
|
||||
boxShadow: AppColors.cardShadowLight,
|
||||
),
|
||||
child: Row(
|
||||
@@ -334,9 +336,9 @@ class _DeviceManagementPageState extends ConsumerState<DeviceManagementPage> {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
gradient: AppColors.surfaceGradient,
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
border: Border.all(color: AppColors.border),
|
||||
border: Border.all(color: AppColors.borderLight),
|
||||
boxShadow: AppColors.cardShadowLight,
|
||||
),
|
||||
child: Column(
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import '../../core/app_colors.dart';
|
||||
import '../../core/app_theme.dart';
|
||||
import '../../core/navigation_provider.dart';
|
||||
import '../../providers/auth_provider.dart';
|
||||
import '../../providers/omron_device_provider.dart';
|
||||
@@ -183,10 +184,9 @@ class _DeviceScanPageState extends ConsumerState<DeviceScanPage>
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
return GradientScaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.white,
|
||||
backgroundColor: Colors.white.withValues(alpha: 0.9),
|
||||
elevation: 0,
|
||||
title: Text(
|
||||
_connected ? _deviceName : '添加设备',
|
||||
@@ -256,7 +256,7 @@ class _DeviceScanPageState extends ConsumerState<DeviceScanPage>
|
||||
height: 80 * _pulseAnim.value,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: AppColors.primary.withValues(alpha: 0.08),
|
||||
color: AppColors.auraIndigo.withValues(alpha: 0.10),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -264,13 +264,14 @@ class _DeviceScanPageState extends ConsumerState<DeviceScanPage>
|
||||
width: 64,
|
||||
height: 64,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.avatarBg,
|
||||
gradient: AppColors.calmHealthGradient,
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
boxShadow: AppColors.buttonShadow,
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.bluetooth_searching,
|
||||
size: 32,
|
||||
color: AppColors.primary,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -301,19 +302,18 @@ class _DeviceScanPageState extends ConsumerState<DeviceScanPage>
|
||||
width: 100,
|
||||
height: 100,
|
||||
decoration: BoxDecoration(
|
||||
color: _readingReceived
|
||||
? AppColors.successLight
|
||||
: AppColors.avatarBg,
|
||||
gradient: _readingReceived
|
||||
? AppColors.calmHealthGradient
|
||||
: AppColors.primaryGradient,
|
||||
borderRadius: BorderRadius.circular(32),
|
||||
boxShadow: AppColors.buttonShadow,
|
||||
),
|
||||
child: Icon(
|
||||
_readingReceived
|
||||
? Icons.check_rounded
|
||||
: Icons.bluetooth_connected,
|
||||
size: 48,
|
||||
color: _readingReceived
|
||||
? const Color(0xFF10B981)
|
||||
: AppColors.primary,
|
||||
color: _readingReceived ? Colors.white : Colors.white,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
@@ -456,9 +456,9 @@ class _DeviceScanPageState extends ConsumerState<DeviceScanPage>
|
||||
margin: const EdgeInsets.only(bottom: 8),
|
||||
padding: const EdgeInsets.all(14),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
gradient: AppColors.surfaceGradient,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: AppColors.border),
|
||||
border: Border.all(color: AppColors.borderLight),
|
||||
boxShadow: AppColors.cardShadowLight,
|
||||
),
|
||||
child: Row(
|
||||
@@ -467,14 +467,10 @@ class _DeviceScanPageState extends ConsumerState<DeviceScanPage>
|
||||
width: 44,
|
||||
height: 44,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.avatarBg,
|
||||
gradient: AppColors.calmHealthGradient,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.bluetooth,
|
||||
size: 22,
|
||||
color: AppColors.primary,
|
||||
),
|
||||
child: const Icon(Icons.bluetooth, size: 22, color: Colors.white),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
@@ -515,8 +511,9 @@ class _DeviceScanPageState extends ConsumerState<DeviceScanPage>
|
||||
vertical: 10,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.primary,
|
||||
gradient: AppColors.primaryGradient,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
boxShadow: AppColors.buttonShadow,
|
||||
),
|
||||
child: const Text(
|
||||
'连接',
|
||||
|
||||
Reference in New Issue
Block a user