permission_checker 0.0.2
permission_checker: ^0.0.2 copied to clipboard
This package should make it easier for developers to interact with native permissions, since there are many different permissions that relate to a single entity, such as access to photos on different [...]
PermissionChecker Package #
PermissionChecker is a convenient Flutter widget designed to simplify working with permissions. It helps developers
avoid the hassle of manually managing permissions for different operating system versions.
Features #
- Easy integration: Handle permissions in one place.
- Supports multiple OS versions.
- Customizable behavior:
- Logic for successful permission granting.
- Logic for handling user denial.
Installation #
Add permission_checker to your project's pubspec.yaml file:
dependencies:
permission_handler: ^0.0.1
Usage Example #
PermissionHandler(
permission: PermissionType.photos, // Type of permission required
onAfterTap: () {}, // Logic after successful permission grant
widget: (onTap) => ElevatedButton(
onPressed: onTap,
child: const Text('Photos'),
), // Widget to trigger permission request
onFailedTap: () => showAdaptiveDialog(
context: context,
builder: (BuildContext context) => const PermissionAlertDialog(),
), // Logic when the user denies permission
);
Real-World Applications #
This widget is ideal for applications requiring access to resources like the camera, photo albums, location, or any other permissions-dependent functionality.