smart_permission
1.1.0, released 4 weeks ago by an unverified publisher
Flutter runtime permissions made easy with adaptive dialogs and permission gates.
What it does
Simplifies handling runtime permissions in Flutter by wrapping permission_handler with one-line requests, adaptive dialogs, rationale flows, and settings round-trips. It also provides a PermissionGate widget to wrap UI that requires specific permissions.
AI-written summary of version 1.1.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to request permissions with automatic adaptive explanation and settings dialogs.
- You want to guard UI widgets behind a permission check using PermissionGate.
- You need a robust fallback flow when permissions are permanently denied or restricted.
Skip it when
- You need permission handling on macOS or Linux platforms, which are not supported.
- You prefer writing custom platform permission dialogs and state management from scratch.
Strengths
- Handles complex permission flows (denied, permanently denied, restricted) automatically.
- Includes a PermissionGate widget that re-checks status when returning to the foreground.
- Provides built-in testing support with FakeSmartPermissionGateway.
Weaknesses
- Relies on permission_handler and inherits its platform limitations (no macOS or Linux support).
- Requires platform-specific configuration in AndroidManifest.xml, Info.plist, and optionally Podfile.
Setup
- Kind
- Flutter widgets
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 1
Requires adding permissions to AndroidManifest.xml, usage descriptions to iOS Info.plist, configuring Gradle compileSdk, and optionally setting up Podfile macros for iOS CocoaPods.
final granted = await SmartPermission.request(
context,
permission: Permission.camera,
description: 'We need the camera to scan QR codes.',
);
if (granted) openScanner();Alternatives
Packages that do the same job and could replace smart_permission.
- app_settings
Open iOS and Android phone settings pages from a Flutter app.
89Compare - permission_manager
Check and request app permissions across Android, iOS, Web, Windows, macOS, and Linux.
57Compare - move_to_background
Flutter plugin for sending mobile applications to background.
47Compare - system_settings
Opens system and app settings pages on iOS and Android.
43Compare
Works with
Packages commonly used together with smart_permission: ones it builds on, ones built on it, and its own family.