expo_permissions 0.1.0

  • Readme
  • Changelog
  • Installing
  • 62

expo_permissions #

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.

Getting Started #

Installation #

Add the plugin as a dependency in your Flutter project's pubspec.yaml file.

  expo_permissions: ^0.1.0

To install it directly from our git repo, specify the dependency as shown below:

      url: git://github.com/expo/expo.git
      path: packages/expo-permissions-flutter-plugin

Usage #

import 'package:expo_permissions/expo_permissions.dart';

This file contains three classes: Permissions, PermissionResponse and PermissionType.

Permissions contains all of the relevant methods for asking for permissions and checking on the status your app's permission levels.

Permissions #

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 #

PermissionResponse is a object that gets returned from the Permissions class's methods.

A 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 "status" and "expires" keys and additional related fields to the permission you've requested.

PermissionType #

PermissionType is a class that holds static constant values for you to use as permission types when using Permissions.ask, Permissions.get, or permissionResponse.get.

0.1.0 #

  • This initial release allows Flutter developers to ask the user for device permissions and check upon the status of a specified permission.

  • These permissions include:

    • camera
    • audio recording
    • location
    • user-facing notifications
    • contacts
    • camera roll
    • calendar
    • reminders

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  expo_permissions: ^0.1.0

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:expo_permissions/expo_permissions.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Dec 13, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.13.1+4
  • Flutter: 1.12.13+hotfix.2

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and expo_permissions.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

The package description is too short. (-1 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
expo_flutter_adapter ^0.1.0 0.1.1
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8