feat: align iOS client safety and consent experience
This commit is contained in:
@@ -438,9 +438,9 @@ class _HomePageState extends ConsumerState<HomePage>
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const SizedBox(height: 8),
|
||||
const SizedBox(height: 4),
|
||||
_buildAgentBar(),
|
||||
const SizedBox(height: 12),
|
||||
const SizedBox(height: 5),
|
||||
if (_pickedImagePath != null) _buildImagePreview(),
|
||||
_buildInputBar(),
|
||||
],
|
||||
@@ -490,13 +490,13 @@ class _HomePageState extends ConsumerState<HomePage>
|
||||
chatProvider.select((state) => state.isStreaming),
|
||||
);
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(12, 0, 12, 10),
|
||||
padding: const EdgeInsets.fromLTRB(12, 0, 12, 6),
|
||||
child: Container(
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
6,
|
||||
elderMode ? 7 : 5,
|
||||
elderMode ? 5 : 3,
|
||||
6,
|
||||
elderMode ? 7 : 5,
|
||||
elderMode ? 5 : 3,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
@@ -540,7 +540,7 @@ class _HomePageState extends ConsumerState<HomePage>
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
horizontal: 4,
|
||||
vertical: elderMode ? 15 : 12,
|
||||
vertical: elderMode ? 12 : 9,
|
||||
),
|
||||
border: InputBorder.none,
|
||||
enabledBorder: InputBorder.none,
|
||||
@@ -971,7 +971,7 @@ class _VoiceHoldSurface extends StatelessWidget {
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 4,
|
||||
vertical: elderMode ? 14 : 11,
|
||||
vertical: elderMode ? 12 : 9,
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
|
||||
@@ -1276,7 +1276,6 @@ class ChatMessagesView extends ConsumerWidget {
|
||||
/// 处理 AI 回复里的 markdown 链接点击:
|
||||
/// - app://diet → 触发拍照/相册选择,跳到饮食拍照流程
|
||||
/// - app://report → 跳到报告列表(用户可在那里上传新报告)
|
||||
/// - app://device → 跳到蓝牙设备页
|
||||
/// - 其他 app://xxx → 当作 route name 直接跳
|
||||
static void _handleMarkdownLink(
|
||||
BuildContext context,
|
||||
@@ -1296,8 +1295,7 @@ class ChatMessagesView extends ConsumerWidget {
|
||||
pushRoute(ref, 'reports');
|
||||
break;
|
||||
case 'device':
|
||||
pushRoute(ref, 'devices');
|
||||
break;
|
||||
return;
|
||||
default:
|
||||
if (uri.host.isNotEmpty) pushRoute(ref, uri.host);
|
||||
}
|
||||
@@ -2199,12 +2197,6 @@ final _agentActions = <ActiveAgent, List<_AgentAction>>{
|
||||
isWide: true,
|
||||
route: 'trend',
|
||||
),
|
||||
_AgentAction(
|
||||
label: '蓝牙录入',
|
||||
icon: Icons.bluetooth,
|
||||
isWide: true,
|
||||
route: 'devices',
|
||||
),
|
||||
],
|
||||
ActiveAgent.diet: [
|
||||
_AgentAction(
|
||||
|
||||
@@ -32,7 +32,15 @@ class AiConsentDetailsPage extends ConsumerWidget {
|
||||
);
|
||||
if (confirmed != true || !context.mounted) return;
|
||||
|
||||
await ref.read(aiConsentProvider.notifier).revoke(userId);
|
||||
final revoked = await ref.read(aiConsentProvider.notifier).revoke(userId);
|
||||
if (!revoked) {
|
||||
if (context.mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Authorization could not be revoked.')),
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
await ref.read(authProvider.notifier).logout();
|
||||
}
|
||||
|
||||
@@ -59,6 +67,7 @@ class AiConsentDetailsPage extends ConsumerWidget {
|
||||
color: AppColors.textPrimary,
|
||||
),
|
||||
),
|
||||
centerTitle: true,
|
||||
),
|
||||
body: SafeArea(
|
||||
child: SingleChildScrollView(
|
||||
@@ -91,8 +100,11 @@ class AiConsentDetailsPage extends ConsumerWidget {
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: OutlinedButton(
|
||||
onPressed: () => _revoke(context, ref),
|
||||
onPressed: consent.isSaving
|
||||
? null
|
||||
: () => _revoke(context, ref),
|
||||
style: OutlinedButton.styleFrom(
|
||||
backgroundColor: Colors.white,
|
||||
foregroundColor: AppColors.error,
|
||||
side: BorderSide(
|
||||
color: AppColors.error.withValues(alpha: 0.4),
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'dart:io';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
@@ -56,13 +55,11 @@ class SettingsPage extends ConsumerWidget {
|
||||
title: '长辈模式',
|
||||
onTap: () => pushRoute(ref, 'elderMode'),
|
||||
),
|
||||
if (!Platform.isIOS)
|
||||
// iOS 审核版:蓝牙设备入口已移除
|
||||
_SettingsTile(
|
||||
icon: LucideIcons.bell,
|
||||
title: '消息通知',
|
||||
onTap: () => pushRoute(ref, 'notificationPrefs'),
|
||||
),
|
||||
_SettingsTile(
|
||||
icon: LucideIcons.bell,
|
||||
title: '消息通知',
|
||||
onTap: () => pushRoute(ref, 'notificationPrefs'),
|
||||
),
|
||||
_SettingsTile(
|
||||
icon: LucideIcons.info,
|
||||
title: '关于小脉健康',
|
||||
|
||||
Reference in New Issue
Block a user