A Flutter plugin for the
expo-permissions Universal Module. It requires
expo-permissions to be installed and linked as well as
expo-flutter-adapter to installed as a peer dependency in your Flutter project.
Add the plugin as a dependency in your Flutter project's
dependencies: expo_permissions: ^0.1.0
To install it directly from our git repo, specify the dependency as shown below:
dependencies: expo_permissions: git: url: git://github.com/expo/expo.git path: packages/expo-permissions-flutter-plugin
This file contains three classes:
Permissions contains all of the relevant methods for asking for permissions and checking on the status your app's permission levels.
The Dart API of the
Permissions class is as follows:
static Future<PermissionResponse> get(List<PermissionType> types)
Permissions.get is a static method that one can use to check the status of the specified permissions.
static Future<PermissionResponse> ask(List<PermissionType> types)
Permissions.ask is a static method that one can use to ask the user for a specific set of device permissions and check how the user responds.
PermissionResponse is a object that gets returned from the
Permissions class's methods.
PermissionResponse has one method,
permissionResponse.get which you can use to get the response of a specified
PermissionType. The type signature for
get is shown below:
Map<String, dynamic> get(PermissionType type)
The map that is returned from the
get method contains the
"expires" keys and additional related fields to the permission you've requested.
PermissionType is a class that holds static constant values for you to use as permission types when using