PermissionService class
Service class for managing runtime permissions across Android and iOS platforms.
Provides simplified permission request methods for common device capabilities such as camera, photos, and location. Handles platform-specific permission logic and checks current permission status before requesting.
All methods return a boolean indicating whether the permission was granted.
Usage:
final permissionService = PermissionService();
// Request camera permission
if (await permissionService.requestCameraPermissions()) {
// Camera access granted, proceed with camera operations
} else {
// Permission denied, show explanation or alternative flow
}
Or access via RtUtils:
if (await Utils.permissionService.requestLocationPermission()) {
// Access user location
}
See also:
- Permission from permission_handler package for additional permissions
RtUtilsfor static access to this service
Constructors
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
-
requestCameraPermissions(
) → Future< bool> - Requests camera permission.
-
requestLocationPermission(
) → Future< bool> - Requests location permission.
-
requestPhotoPermissions(
) → Future< bool> - Requests photo library/gallery permission.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited