permission_handler_auto_back 0.0.2
permission_handler_auto_back: ^0.0.2 copied to clipboard
Wraps permission_handler and brings your Flutter app back to the foreground on Android after the user grants a special permission in Settings.
0.0.2 #
- Declare plugin support for Web, Windows, Linux and macOS so pub.dev no
longer flags them as unsupported. The auto-back behaviour stays
Android-only; on Web and Windows
requestWithAutoBack()delegates topermission_handler's native implementation, and on Linux/macOS — wherepermission_handlerships no platform code — it short-circuits toPermissionStatus.grantedinstead of throwingMissingPluginException.
0.0.1 #
Initial release. Re-exports permission_handler and adds the
Permission.requestWithAutoBack() extension that opens the right Android
Settings page when needed, polls the system for the granted state, and
brings the host app back to the foreground automatically when the user
toggles the permission on.
- Re-exports the full
permission_handlerAPI. - Adds
Permission.requestWithAutoBack():- Opens the appropriate Android Settings page for special permissions
(
manageExternalStorage,systemAlertWindow,requestInstallPackages,scheduleExactAlarm,ignoreBatteryOptimizations,accessNotificationPolicy). - Falls back to the app details page for any runtime permission that has been permanently denied.
- Polls the system every 500 ms and brings the host app back to the foreground automatically once the permission is granted.
- For
Permission.locationAlwaysit grants foreground location first, then delegates topermission_handler.request()so the OS itself redirects the user to the app's location-permission page (Android 11+) or shows the Allow all the time dialog (Android 10), while the native side pollsACCESS_BACKGROUND_LOCATIONin parallel and auto-backs as soon as the toggle flips on.
- Opens the appropriate Android Settings page for special permissions
(
- Adds
cancelPermissionAutoBack()to abort an in-flight polling loop. - Runtime permission auto-back covers
camera,microphone,location,locationWhenInUse,locationAlways,contacts,phone,sms,storage,photos,videos,audio,notification,calendar,calendarFullAccess,calendarWriteOnly,sensors,sensorsAlways,bluetooth,bluetoothScan,bluetoothConnect,bluetoothAdvertise,nearbyWifiDevices,activityRecognition,accessMediaLocation. - iOS is a passthrough to
permission_handler; auto-back is Android-only because iOS does not support programmatic foreground return from the Settings app. - README documents the
permission_handleriOS preprocessor macros (PERMISSION_CAMERA=1,PERMISSION_LOCATION=1, …) that must be declared inios/Podfilefor the system permission dialog to appear. - Example app demonstrates a recovery dialog that opens app settings
when
requestWithAutoBack()resolves topermanentlyDenied.
This package supersedes
flutter_permission_auto_return,
which has been discontinued in favor of this one.