PackageUsageStats class

A static class for accessing PACKAGE_USAGE_STATS API of Android.

Constructors

PackageUsageStats()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

onPermissionStatusChanged Stream<bool?>
Starts listening for the PACKAGE_USAGE_STATS permission status change. This method is useful when you want to know the status of the permission at any point of time, including the time when the app is backgrounded. Returns a stream of bool? events, indicating the current status of the permission.
no setter

Static Methods

checkPermissionStatus() Future<bool>
Checks the permission status for android.manifest.PACKAGE_USAGE_STATS @returns {Promise
openAppUsageSettings() Future<bool>
Opens an activity window where the user can see all the apps those request the PACKAGE_USAGE_STATS permission. Upon selecting the desired app, user can grant or deny the permission. Because PACKAGE_USAGE_STATS considered as a dangerous permission, it is the only way to get the permission on Android.