What should you do when a permission is permanently denied?
When a permission is permanently denied, the system will not show the permission dialog again. You must guide the user to the app settings screen where they can enable it manually.
Handle runtime permissions and deep link navigation
You can read this lesson publicly. Sign in to unlock exercises, quiz, and FX progress tracking.
Having trouble? AI is here to help
Ask context-aware questions about this lesson. Free plan: 5 questions/day. Upgrade to Premium for higher daily limits.
Use the AI button at the bottom of the screen
Permissions are required to access sensitive device features like the camera, microphone, location, and storage. On both Android and iOS, users must explicitly grant permission before your app can use these features. The permission_handler package provides a unified Dart API for requesting and checking permission status across platforms. Permissions can be in one of several states including granted, denied, and permanently denied. When a user permanently denies a permission, the system will not show the permission dialog again and you must guide the user to the app settings screen. Deep links allow users to open a specific screen inside your app directly from a URL. For example, a URL like myapp.com/product/123 can open your app and navigate straight to the product detail screen for item 123. On Android, deep links are configured through intent filters in AndroidManifest.xml. On iOS, they are set up through Associated Domains in Xcode. The go_router package is the officially recommended routing solution that simplifies deep link handling with path parameters, query parameters, and redirect logic.
1// ── PERMISSIONS ──2// pubspec.yaml: permission_handler: ^11.0.03import 'package:permission_handler/permission_handler.dart';45// Request camera permission6Future<bool> requestCamera() async {7final status = await Permission.camera.request();89if (status.isGranted) {10return true;11} else if (status.isDenied) {12// User denied, can ask again13return false;14} else if (status.isPermanentlyDenied) {15// User permanently denied: open settings16await openAppSettings();17return false;18}19return false;20}2122// Check multiple permissions23Future<void> checkPermissions() async {24Map<Permission, PermissionStatus> statuses = await [25Permission.camera,26Permission.microphone,27Permission.location,28].request();2930if (statuses[Permission.camera]!.isGranted) {31print('Camera granted');32}33}
1// ── DEEP LINKING ──2// In MaterialApp:3MaterialApp(4// Handle deep links5onGenerateRoute: (settings) {6final uri = Uri.parse(settings.name ?? '');78// myapp://product/1239if (uri.pathSegments.length == 2 && uri.pathSegments[0] == 'product') {10final id = uri.pathSegments[1];11return MaterialPageRoute(12builder: (_) => ProductDetailScreen(productId: id),13);14}15return MaterialPageRoute(builder: (_) => const HomeScreen());16},17)1819// ── With go_router (recommended) ──20// pubspec.yaml: go_router: ^12.0.021final router = GoRouter(22routes: [23GoRoute(24path: '/',25builder: (context, state) => const HomeScreen(),26),27GoRoute(28path: '/product/:id',29builder: (context, state) {30final id = state.pathParameters['id']!;31return ProductDetailScreen(productId: id);32},33),34],35);3637// Navigate: context.go('/product/123');
For Android, add intent-filters in AndroidManifest.xml. For iOS, configure Associated Domains in Xcode. The go_router package simplifies deep link handling significantly.
Permission flows should be staged and contextual:
Context-aware permission UX improves grant rates and reduces drop-off.
Handle runtime permissions and deep link navigation. Navigation manages how users move between screens and return to previous states.
Think in architecture, reliability, and team-level maintainability.
Design route names and arguments before wiring screen UI.
Poor routing decisions create confusing UX and fragile deep-link behavior.
Centralized route strategy reduces hidden coupling between features and screens.
As your app grows, keep UI, state, and data responsibilities separate so each part stays testable and easier to modify.
When a permission is permanently denied, the system will not show the permission dialog again. You must guide the user to the app settings screen where they can enable it manually.
go_router is the officially recommended routing package that supports deep linking, path parameters, and web URLs.
Create a list of Permission objects and call .request() on the list to batch-request multiple permissions.
Something seems incorrect, unclear, or missing? Let us know.
FlutterCraft editorial lessons are reviewed by experienced Flutter developers and updated to stay aligned with modern Flutter and Dart best practices.
Reference docs: Flutter Documentation, Dart Language Tour, and official package documentation where relevant.
Sign in to continue with exercises and quiz for this lesson.
Sign In to Continue