Permission_checker function
dynamic
Permission_checker()
Implementation
Permission_checker() async {
Map<Permission, PermissionStatus> statuses = await [
Permission.storage,
Permission.manageExternalStorage, // Only needed on Android 11 and above
Permission.camera,
Permission.microphone,
Permission.location,
Permission.locationWhenInUse,
Permission.locationAlways,
Permission.notification,
].request();
// Check each permission and handle denial cases as needed
if (statuses[Permission.storage]?.isDenied ?? true) {
print("Storage permission denied");
}
if (statuses[Permission.manageExternalStorage]?.isDenied ?? true) {
print("Manage external storage permission denied");
}
}