expo_permissions 0.1.0

  • README.md
  • Installing
  • Versions
  • 54

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';
Version Uploaded Documentation Archive
0.1.0 Feb 17, 2019 Go to the documentation of expo_permissions 0.1.0 Download expo_permissions 0.1.0 archive
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 Jun 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.2
  • pana: 0.12.18
  • Flutter: 1.5.4-hotfix.2


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance issues and suggestions

Support latest dependencies. (-5 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency.

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.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8