Skip to content

Commit 8faa137

Browse files
committed
Updated permission disclosure
1 parent 04c6d96 commit 8faa137

File tree

3 files changed

+16
-21
lines changed

3 files changed

+16
-21
lines changed

lib/screens/main_scaffold.dart

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,10 @@ class _MainScaffoldState extends State<MainScaffold> {
5959
// Show the disclosure dialog
6060
if (!mounted) return;
6161
debugLog('[DISCLOSURE] Showing location disclosure dialog');
62-
final accepted = await PermissionDisclosureService.showLocationDisclosure(context);
62+
await PermissionDisclosureService.showLocationDisclosure(context);
6363

64-
if (accepted) {
65-
debugLog('[DISCLOSURE] User accepted, requesting permissions');
66-
await _requestPermissionsAfterDisclosure();
67-
} else {
68-
debugLog('[DISCLOSURE] User declined location access');
69-
}
64+
debugLog('[DISCLOSURE] User acknowledged, requesting permissions');
65+
await _requestPermissionsAfterDisclosure();
7066
}
7167

7268
/// Request permissions after user accepts disclosure

lib/screens/settings_screen.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'dart:io' show File;
33

44
import 'package:flutter/foundation.dart' show kIsWeb, defaultTargetPlatform, TargetPlatform;
55
import 'package:flutter/material.dart';
6+
import 'package:flutter/services.dart';
67
import 'package:provider/provider.dart';
78
import 'package:file_picker/file_picker.dart';
89
import 'package:geolocator/geolocator.dart';
@@ -23,6 +24,7 @@ import '../services/offline_session_service.dart';
2324
import '../services/permission_disclosure_service.dart';
2425
import '../utils/constants.dart';
2526
import '../widgets/bug_report_dialog.dart';
27+
import 'package:intl/intl.dart';
2628
import '../widgets/app_toast.dart';
2729

2830
/// Settings screen for user preferences and API configuration
@@ -129,6 +131,9 @@ class _SettingsScreenState extends State<SettingsScreen> {
129131
}
130132

131133
void _onVersionTap(AppStateProvider appState) {
134+
// Copy version to clipboard on every tap
135+
Clipboard.setData(ClipboardData(text: AppConstants.appVersion));
136+
132137
final now = DateTime.now();
133138

134139
// Reset if last tap was more than 2 seconds ago
@@ -141,7 +146,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
141146
_versionTapCount++;
142147

143148
if (appState.developerModeEnabled) {
144-
AppToast.simple(context, 'Developer mode already enabled');
149+
AppToast.simple(context, 'Version copied to clipboard');
145150
return;
146151
}
147152

@@ -156,6 +161,8 @@ class _SettingsScreenState extends State<SettingsScreen> {
156161
'$remaining taps to enable developer mode',
157162
duration: const Duration(milliseconds: 800),
158163
);
164+
} else {
165+
AppToast.simple(context, 'Version copied to clipboard');
159166
}
160167
}
161168

lib/services/permission_disclosure_service.dart

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ class PermissionDisclosureService {
1919
}
2020

2121
/// Show the prominent disclosure dialog
22-
/// Returns true if user accepts, false if they decline
23-
static Future<bool> showLocationDisclosure(BuildContext context) async {
24-
final result = await showDialog<bool>(
22+
/// Always proceeds to system permission prompt after user taps Continue
23+
static Future<void> showLocationDisclosure(BuildContext context) async {
24+
await showDialog<void>(
2525
context: context,
2626
barrierDismissible: false,
2727
builder: (context) => AlertDialog(
@@ -66,23 +66,15 @@ class PermissionDisclosureService {
6666
),
6767
),
6868
actions: [
69-
TextButton(
70-
onPressed: () => Navigator.of(context).pop(false),
71-
child: const Text('Decline'),
72-
),
7369
FilledButton(
74-
onPressed: () => Navigator.of(context).pop(true),
70+
onPressed: () => Navigator.of(context).pop(),
7571
child: const Text('Continue'),
7672
),
7773
],
7874
),
7975
);
8076

81-
if (result == true) {
82-
await markDisclosureShown();
83-
}
84-
85-
return result ?? false;
77+
await markDisclosureShown();
8678
}
8779

8880
/// Show the background location disclosure (for "Always" permission)

0 commit comments

Comments
 (0)