user_permission 0.1.0 copy "user_permission: ^0.1.0" to clipboard
user_permission: ^0.1.0 copied to clipboard

PlatformAndroid

Flutter plugin for watching User Permission. Not supported on iOS.

user_permission #

This plugin provides Android applications with the ability to obtain the status of special app access and detect changes. Specifically, it has the following functions:

  1. Get status of special app access:

    This plugin checks whether the app has been granted special app access permission.

  2. Launch screen for status change:

    It has the ability to launch the settings screen required for granting special app access. Through this plugin, users can access the settings screen to easily grant the necessary permissions to the app.

  3. Detect status change:

    It can detect changes in the status of special app access in real time. This allows you to automatically return to your app from the settings screen.

Platform Support #

Android

Supported User Permissions #

User Permission Note
Usage access
Display over other apps
Picture-in-picture
Modify system settings
Alarm & reminders When this user permission is turned off, your app process will be terminated.
Accessibility When this user permission is turned off, your app process will be terminated.

Usage #

To use this plugin, add user_permission as a dependency in your pubspec.yaml file.

Get status #

import 'package:user_permission/user_permission.dart';
import 'package:user_permission/user_permission_type.dart';

final state = await UserPermission().state(UserPermissionType.usageStats);

Launch screen & Detect status change #

import 'package:user_permission/user_permission.dart';
import 'package:user_permission/user_permission_type.dart';

final state = await UserPermission().startWatching(UserPermissionType.systemAlertWindow);

Status value #

The status can be either denied or granted.
If denied, it's a good idea to ask the user for permission with startWatching.

import 'package:user_permission/user_permission.dart';
import 'package:user_permission/user_permission_type.dart';

final userPermission = UserPermission();
final state = await userPermission.state(UserPermissionType.usageStats);
if (state.isDenied) {
    await userPermission.startWatching(UserPermissionType.usageStats);
}

Learn more #

2
likes
150
points
32
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter plugin for watching User Permission. Not supported on iOS.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on user_permission

Packages that implement user_permission