feat: align iOS client safety and consent experience
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user