simple_permissions 0.1.0

  • Example
  • Installing
  • Versions
  • new50

Simple Permissions

A new flutter plugin for checking and requesting permissions on iOs and Android.

Getting Started

Make sure you add the needed permissions to your Android Manifest Permission and Info.plist.

<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />


List of currently available permissions

enum Permission {
  // Microphone

  // Camera

  // External Storage

  // Access Coarse Location (Android) / When In Use iOs

  // Access Fine Location (Android) / When In Use iOS

  // Access Fine Location (Android) / When In Use iOS

  // Access Fine Location (Android) / Always Location iOS  


  /// Check a [permission] and return a [Future] with the result
  static Future<bool> checkPermission(Permission permission);

  /// Request a [permission] and return a [Future] with the result
  static Future<bool> requestPermission(Permission permission);

  /// Open app settings on Android and iOs
  static Future<bool> openSettings();

[0.1.0] - 14.03.2018

  • Initial release


import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:simple_permissions/simple_permissions.dart';

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  _MyAppState createState() => new _MyAppState();

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';
  Permission permission;

  initState() {

  // Platform messages are asynchronous, so we initialize in an async method.
  initPlatformState() async {
    String platformVersion;
    // Platform messages may fail, so we use a try/catch PlatformException.
    try {
      platformVersion = await SimplePermissions.platformVersion;
    } on PlatformException {
      platformVersion = 'Failed to get platform version.';

    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    setState(() {
      _platformVersion = platformVersion;

  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text('Plugin example app'),
        body: new Center(
          child: new Column(children: <Widget>[
            new Text('Running on: $_platformVersion\n'),
            new DropdownButton(items: _getDropDownItems(), value: permission, onChanged: onDropDownChanged),
            new RaisedButton(onPressed: checkPermission, child: new Text("Check permission")),
            new RaisedButton(onPressed: requestPermission, child: new Text("Request permission")),
            new RaisedButton(onPressed: SimplePermissions.openSettings, child: new Text("Open settings"))

  onDropDownChanged(Permission permission) {
    setState(() => this.permission = permission);

  requestPermission() async {
    bool res = await SimplePermissions.requestPermission(permission);
    print("permission request result is " + res.toString());

  checkPermission() async {
   bool res = await SimplePermissions.checkPermission(permission);
   print("permission is " + res.toString());

  List<DropdownMenuItem<Permission>>_getDropDownItems() {
    List<DropdownMenuItem<Permission>> items = new List();
    Permission.values.forEach((permission) {
      var item  = new DropdownMenuItem(child: new Text(getPermissionString(permission)), value: permission);
    return items;

1. Depend on it

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

  simple_permissions: "^0.1.0"

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:

import 'package:simple_permissions/simple_permissions.dart';
Version Uploaded Documentation Archive
0.1.0 Mar 14, 2018 Go to the documentation of simple_permissions 0.1.0 Download simple_permissions 0.1.0 archive


We analyzed this package on Mar 14, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.32.0
  • pana: 0.10.3
  • Flutter: 0.1.7


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


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.


  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0
flutter 0.0.0
Transitive dependencies
async 2.0.6
charcode 1.1.1
collection 1.14.5 1.14.7
http 0.11.3+16
http_parser 3.1.1
meta 1.1.2
path 1.5.1
sky_engine 0.0.99
source_span 1.4.0
string_scanner 1.0.2
typed_data 1.1.5
vector_math 2.0.5