Commit 95158f7a by Maurits van Beusekom

Release 4.3.0

parents d6d3621e 883cd349
...@@ -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();
......
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