mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-09 02:07:58 -06:00
Removed unused files, code cleanup
This commit is contained in:
14
lib/helpers/permission_helpers.dart
Normal file
14
lib/helpers/permission_helpers.dart
Normal file
@@ -0,0 +1,14 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
|
||||
Future<bool> askForPermission(Permission permission) async {
|
||||
final status = await permission.request();
|
||||
log("Permission requested, new status is $status");
|
||||
// If user has permanently declined permission, open settings.
|
||||
if (status == PermissionStatus.permanentlyDenied) {
|
||||
await openAppSettings();
|
||||
}
|
||||
|
||||
return status == PermissionStatus.granted;
|
||||
}
|
||||
Reference in New Issue
Block a user