Commit e3945eb1 by Maurits van Beusekom

Release 4.3.0

parents cc0a288e 95158f7a
## 4.3.0
* Allow requesting location permissions when location services are disabled (on iOS this will redirect the user to the Location settings page);
* Android: Add support for requesting Activity Recognition permissions;
* Confirm to Effective Dart guidelines;
* Documented all public API members;
* Fixed several typos in the README.md.
## 4.2.0+hotfix.3 ## 4.2.0+hotfix.3
* Android: Fixes a bug which in some cases caused the permission `neverAskAgain` to be returned incorrectly. * Android: Fixes a bug which in some cases caused the permission `neverAskAgain` to be returned incorrectly.
......
...@@ -17,7 +17,7 @@ To use this plugin, add `permission_handler` as a [dependency in your pubspec.ya ...@@ -17,7 +17,7 @@ To use this plugin, add `permission_handler` as a [dependency in your pubspec.ya
```yaml ```yaml
dependencies: dependencies:
permission_handler: '^4.2.0+hotfix.3' permission_handler: '^4.3.0'
``` ```
> **NOTE:** As of version 3.1.0 the permission_handler plugin switched to the AndroidX version of the Android Support Libraries. This means you need to make sure your Android project is also upgraded to support AndroidX. Detailed instructions can be found [here](https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility). > **NOTE:** As of version 3.1.0 the permission_handler plugin switched to the AndroidX version of the Android Support Libraries. This means you need to make sure your Android project is also upgraded to support AndroidX. Detailed instructions can be found [here](https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility).
......
...@@ -5,7 +5,7 @@ import 'package:permission_handler/permission_handler.dart'; ...@@ -5,7 +5,7 @@ import 'package:permission_handler/permission_handler.dart';
void main() => runApp(MyApp()); void main() => runApp(MyApp());
/// Example Flutter Application demonstrating the functionality of the /// Example Flutter Application demonstrating the functionality of the
/// Permission Handler plugin. /// Permission Handler plugin.
class MyApp extends StatelessWidget { class MyApp extends StatelessWidget {
@override @override
...@@ -51,7 +51,7 @@ class MyApp extends StatelessWidget { ...@@ -51,7 +51,7 @@ class MyApp extends StatelessWidget {
} }
} }
/// Permission widget which displays a permission and allows users to request /// Permission widget which displays a permission and allows users to request
/// the permissions. /// the permissions.
class PermissionWidget extends StatefulWidget { class PermissionWidget extends StatefulWidget {
/// Constructs a [PermissionWidget] for the supplied [PermissionGroup]. /// Constructs a [PermissionWidget] for the supplied [PermissionGroup].
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# #
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'permission_handler' s.name = 'permission_handler'
s.version = '4.2.0+hotfix.3' s.version = '4.3.0'
s.summary = 'Permission plugin for Flutter.' s.summary = 'Permission plugin for Flutter.'
s.description = <<-DESC s.description = <<-DESC
Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions. Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.
......
...@@ -11,15 +11,15 @@ class PermissionStatus { ...@@ -11,15 +11,15 @@ class PermissionStatus {
/// Permission to access the requested feature is granted by the user. /// Permission to access the requested feature is granted by the user.
static const PermissionStatus granted = PermissionStatus._(1); static const PermissionStatus granted = PermissionStatus._(1);
/// Permission to access the requested feature is denied by the OS (only on /// Permission to access the requested feature is denied by the OS (only on
/// iOS). The user cannot change this app's status, possibly due to active /// iOS). The user cannot change this app's status, possibly due to active
/// restrictions such as parental controls being in place. /// restrictions such as parental controls being in place.
static const PermissionStatus restricted = PermissionStatus._(2); static const PermissionStatus restricted = PermissionStatus._(2);
/// Permission is in an unknown state /// Permission is in an unknown state
static const PermissionStatus unknown = PermissionStatus._(3); static const PermissionStatus unknown = PermissionStatus._(3);
/// Permission to access the requested feature is denied by the user and /// Permission to access the requested feature is denied by the user and
/// never show selected (only on Android). /// never show selected (only on Android).
static const PermissionStatus neverAskAgain = PermissionStatus._(4); static const PermissionStatus neverAskAgain = PermissionStatus._(4);
...@@ -60,7 +60,7 @@ class ServiceStatus { ...@@ -60,7 +60,7 @@ class ServiceStatus {
/// There is no service for the supplied permission group. /// There is no service for the supplied permission group.
static const ServiceStatus notApplicable = ServiceStatus._(2); static const ServiceStatus notApplicable = ServiceStatus._(2);
/// The unknown service status indicates the state of the service could not /// The unknown service status indicates the state of the service could not
/// be determined. /// be determined.
static const ServiceStatus unknown = ServiceStatus._(3); static const ServiceStatus unknown = ServiceStatus._(3);
...@@ -150,7 +150,7 @@ class PermissionGroup { ...@@ -150,7 +150,7 @@ class PermissionGroup {
static const PermissionGroup speech = PermissionGroup._(13); static const PermissionGroup speech = PermissionGroup._(13);
/// Android: External Storage /// Android: External Storage
/// iOS: Access to folders like `Documents` or `Downloads`. Implicitly /// iOS: Access to folders like `Documents` or `Downloads`. Implicitly
/// granted. /// granted.
static const PermissionGroup storage = PermissionGroup._(14); static const PermissionGroup storage = PermissionGroup._(14);
...@@ -162,7 +162,7 @@ class PermissionGroup { ...@@ -162,7 +162,7 @@ class PermissionGroup {
/// iOS: Notification /// iOS: Notification
static const PermissionGroup notification = PermissionGroup._(16); static const PermissionGroup notification = PermissionGroup._(16);
/// Android: Allows an application to access any geographic locations /// Android: Allows an application to access any geographic locations
/// persisted in the user's shared collection. /// persisted in the user's shared collection.
static const PermissionGroup accessMediaLocation = PermissionGroup._(17); static const PermissionGroup accessMediaLocation = PermissionGroup._(17);
......
...@@ -13,8 +13,8 @@ class PermissionHandler { ...@@ -13,8 +13,8 @@ class PermissionHandler {
/// Constructs a singleton instance of [Geolocator]. /// Constructs a singleton instance of [Geolocator].
/// ///
/// When a second instance is created, the first instance will not be able to /// When a second instance is created, the first instance will not be able to
/// listen to the EventChannel because it is overridden. Forcing the class to /// listen to the EventChannel because it is overridden. Forcing the class to
/// be a singleton class can prevent misuse of creating a second instance /// be a singleton class can prevent misuse of creating a second instance
/// from a programmer. /// from a programmer.
factory PermissionHandler() { factory PermissionHandler() {
if (_instance == null) { if (_instance == null) {
...@@ -37,7 +37,7 @@ class PermissionHandler { ...@@ -37,7 +37,7 @@ class PermissionHandler {
/// Check current permission status. /// Check current permission status.
/// ///
/// Returns a [Future] containing the current permission status for the /// Returns a [Future] containing the current permission status for the
/// supplied [PermissionGroup]. /// supplied [PermissionGroup].
Future<PermissionStatus> checkPermissionStatus( Future<PermissionStatus> checkPermissionStatus(
PermissionGroup permission) async { PermissionGroup permission) async {
...@@ -79,7 +79,7 @@ class PermissionHandler { ...@@ -79,7 +79,7 @@ class PermissionHandler {
/// Open the App settings page. /// Open the App settings page.
/// ///
/// Returns [true] if the app settings page could be opened, /// Returns [true] if the app settings page could be opened,
/// otherwise [false] is returned. /// otherwise [false] is returned.
Future<bool> openAppSettings() async { Future<bool> openAppSettings() async {
final hasOpened = await _methodChannel.invokeMethod('openAppSettings'); final hasOpened = await _methodChannel.invokeMethod('openAppSettings');
......
...@@ -13,7 +13,7 @@ class Codec { ...@@ -13,7 +13,7 @@ class Codec {
return ServiceStatus.values[value]; return ServiceStatus.values[value];
} }
/// Converts the supplied [Map] of integers into a [Map] of /// Converts the supplied [Map] of integers into a [Map] of
/// [PermissionGroup] key and [PermissionStatus] value instances. /// [PermissionGroup] key and [PermissionStatus] value instances.
static Map<PermissionGroup, PermissionStatus> decodePermissionRequestResult( static Map<PermissionGroup, PermissionStatus> decodePermissionRequestResult(
Map<int, int> value) { Map<int, int> value) {
...@@ -23,7 +23,7 @@ class Codec { ...@@ -23,7 +23,7 @@ class Codec {
} }
/// Converts the supplied [List] containing [PermissionGroup] instances into /// Converts the supplied [List] containing [PermissionGroup] instances into
/// a [List] containing integers which can be used to send on the Flutter /// a [List] containing integers which can be used to send on the Flutter
/// method channel. /// method channel.
static List<int> encodePermissionGroups(List<PermissionGroup> permissions) { static List<int> encodePermissionGroups(List<PermissionGroup> permissions) {
return permissions.map((it) => it.value).toList(); return permissions.map((it) => it.value).toList();
......
name: permission_handler name: permission_handler
description: Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions. description: Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.
version: 4.2.0+hotfix.3 version: 4.3.0
homepage: https://github.com/baseflowit/flutter-permission-handler homepage: https://github.com/baseflowit/flutter-permission-handler
environment: environment:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment