checkPermissions method
Check if the app has necessary permissions
Implementation
Future<bool> checkPermissions() async {
try {
// Check camera and storage permissions
final bool hasCameraPermission = await _plugin.checkCameraPermission();
final bool hasStoragePermission = await _plugin.checkStoragePermission();
print('Camera permission: $hasCameraPermission');
print('Storage permission: $hasStoragePermission');
return hasCameraPermission && hasStoragePermission;
} catch (e) {
print('Error checking permissions: $e');
return false;
}
}