super_easy_permissions

Creator: coderz1093

Last updated:

0 purchases

TODO
Add to Cart

Description:

super easy permissions

super_easy_permissions #
A flutter plugin for handling permissions on Android/iOS in a super simple way.
Please support me via Donation. Your donation seriously motivates me to build many useful plugins like this.
How to use #
Step 1: #
First add this package in your pubspec.yaml file:
dependencies:
flutter:
sdk: flutter
super_easy_permissions: any
copied to clipboard
Make sure to GET all the pub packages after saving this file.
Step 2: #
Android
Add the required permissions in your AndroidManifest.xml file:
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
copied to clipboard
In this case, I have added camera permission (which also require adding hardware feature). Your's case may be different. For example, You may require storage permissions.
NOTE: If you need to add storage permissions in AndroidManifest.xml, make sure to add the following line in manifest file:
<application
android:requestLegacyExternalStorage="true"
...
copied to clipboard
For a list of all permissions, visit Google Developers site.
iOS
Add required permissions in Info.plist file:
<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) camera description.</string>
copied to clipboard
In this case, I have added camera permission. Your need may be different.
For a list of all permissions, visit Apple Developers site.
Step 3 #
Import the library in your dart file:
import 'package:super_easy_permissions/super_easy_permissions.dart';
copied to clipboard
Step 4 #
Finally, use the package
Check if permission is granted
bool result = await SuperEasyPermissions.isGranted(Permissions.camera);
if (result) {
// Permission is granted, do something
}
copied to clipboard
Ask for permission
bool result = await SuperEasyPermissions.askPermission(Permissions.camera);
if (result) {
// Permission is granted, do something
} else {
// Permission denied, do something else
}
copied to clipboard
Check if permission is denied
bool result = await SuperEasyPermissions.isDenied(Permissions.camera);
if (result) {
// Permission is denied, do something
}
copied to clipboard
Permissions Reference #
Permissions.accessMediaLocation // for android only
Permissions.activityRecognition // for android only
Permissions.bluetooth
Permissions.calendar
Permissions.camera
Permissions.contacts
Permissions.ignoreBatteryOptimizations // for ios only
Permissions.location
Permissions.locationAlways
Permissions.locationWhenInUse
Permissions.mediaLibrary // for ios only
Permissions.microphone
Permissions.notification
Permissions.phone // for android only
Permissions.photos // for ios only
Permissions.photosAddOnly // for ios only
Permissions.reminders // for ios only
Permissions.sensors
Permissions.sms // for android only
Permissions.speech
Permissions.storage
copied to clipboard
Other useful packages #

super_easy_in_app_purchase

References #

API docs of this package
Complete example on github

Issues #
Don't hesitate to email any issues or feature at riturajshakti@gmail.com.
Want to contribute #
Please support me via Donation.
Your donation seriously motivates me to develop more useful packages like this.
Author #
This Permission plugin for Flutter is developed by Rituraj Shakti. You can contact me at riturajshakti@gmail.com

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.