feat: align iOS client safety and consent experience

This commit is contained in:
MingNian
2026-07-29 13:30:34 +08:00
parent 3b5cec10a6
commit 01f4955e0e
11 changed files with 290 additions and 374 deletions

View File

@@ -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),

View File

@@ -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: '关于小脉健康',