smart_permission 1.0.1
smart_permission: ^1.0.1 copied to clipboard
Flutter runtime permissions made easy: one-line requests, adaptive dialogs, and full flows on Android & iOS.
1.0.1 #
Documentation polish.
- README: fixed the result-API example (switch cases containing only
comments silently fall through in Dart 3; replaced with an if/else chain
using
result.canProceed) - README: refreshed the feature lists to cover the 1.0.0 capabilities (rich results, restricted flow, settings-return wait, rationale-first, localization, analytics hooks, test gateway)
1.0.0 #
First stable release. The 0.x API keeps working — request(...) and
requestMultiple(...) are unchanged in signature and return type. See the
README's "Migrating from 0.x" section.
Dependencies #
- Upgraded
permission_handlerto ^13.0.1. Android apps must build withcompileSdk 37— Flutter's default is still 36, so setcompileSdk = 37explicitly inandroid/app/build.gradle(.kts).
New #
SmartPermission.requestResult/requestMultipleResults: return aSmartPermissionResult(granted / limited / provisional / denied / permanentlyDenied / restricted / error) instead of a bare bool.contextis optional whenconfig.navigatorKeyis set.SmartPermissionStrings: every built-in dialog string is now replaceable for localization viaconfig.strings.showRationaleFirst(per call) andconfig.showRationaleBeforeRequest(global): show the explanation dialog before the first native prompt.config.navigatorKeyis now actually used: set it to show dialogs without passing aBuildContext.config.defaultDialogStyleis now actually used as the fallback style.config.onError: observe internal platform/dialog errors (e.g. to forward to Crashlytics).config.gateway(SmartPermissionGateway): injectable platform access so apps can widget-test their permission flows without platform channels.config.resetToDefaults()for tests.- Analytics: new
onRequested,onGranted, andonRestrictedhooks, and the denied hook now also fires when the user denies the native prompt after accepting the rationale.InMemoryPermissionAnalyticsTrackergained matching counters. - Built-in title/description for
Permission.accessLocalNetwork(Android 17, new in permission_handler 13).
Fixed #
- Settings flow: after "Open Settings" the package now waits for the user to return to the app before re-checking the permission (previously it re-checked immediately, which almost always reported a stale denial).
restricted(e.g. parental controls) no longer sends users to app settings — settings cannot fix a restricted permission; an informational dialog is shown instead.provisional(iOS provisional notifications) and already-limitedstatuses are treated as usable instead of re-prompting.- The permanently-denied dialog now uses the same description-resolution chain (explicit > provider > built-in) as the rationale dialog.
- Removed the
dart:ioplatform check that could crash on web and made the package incompatible with WebAssembly. The package (and its updated web dependency chain) now compiles withflutter build web --wasm.
Changed #
requestMultiplenow runs one native batch flow and shows a single combined rationale dialog (and a single combined settings dialog) instead of a full per-permission dialog sequence.- Analytics trackers should
extends PermissionAnalyticsTracker; if you usedimplements, add the new hooks or switch toextends. - Packaging:
install.shand the README hero image are no longer shipped in the package archive (README now loads the image from GitHub).
0.0.3 #
Platform support and example updates.
- Platforms: Declared support for Android, iOS, Web, and Windows
- Core: Added robust try/catch + debug logs around permission flows
- Core: Fallback dialog if opening app settings is unsupported/fails (web/windows)
- Example: Added "Location (web/windows)" button to test browser/system flows
- Example: Scaffolded Windows runner; removed macOS from declared platforms
- Tooling: Project formatted and analyzed via FVM
0.0.2 #
Improvements and maintenance.
- README: Added full‑width hero image and small copy refinements
- Pubspec: Shortened description to 60–180 chars for SEO/snippet display
- Lints: Fixed dangling library doc by adding
library smart_permission; - Lints: Addressed
use_build_context_synchronouslywithcontext.mountedchecks - API: Replaced deprecated
Permission.calendarwithcalendarWriteOnlyandcalendarFullAccess - Example: Added curly braces for single‑line if statements to satisfy lints
0.0.1 #
Initial release.
- Core: Simple permission API wrapping
permission_handler- Single:
SmartPermission.request(context, permission: ...) - Batch:
SmartPermission.requestMultiple(context, permissions: [...])
- Single:
- UI: Adaptive dialogs (Material/Cupertino) with configurable style
- Config: Global theming (light/dark, primaryColor)
- Content: Built-in per-permission titles and descriptions with override providers
- Customization:
customDialogBuilderhook - Analytics: Hook interface + default in-memory tracker
- Re-exports:
Permissiontypes so apps only import this package - Example app: Android/iOS demo with theme toggle, style selector, custom builder demo
- Platform refs: Example
AndroidManifest.xml, iOSInfo.plistand Podfile macros - Tooling: README, GitHub CI (format, analyze, test), starter tests