You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
HMG_Patient_App_New/lib/features/hospital/AppPermission.dart

28 lines
976 B
Dart

2 months ago
import 'package:flutter/cupertino.dart';
import 'package:permission_handler/permission_handler.dart';
class AppPermission {
static Future<bool> askVideoCallPermission(BuildContext context) async {
if (!(await Permission.camera.request().isGranted) || !(await Permission.microphone.request().isGranted)) {
return false;
}
// if (Platform.isAndroid && !(await PlatformBridge.shared().isDrawOverAppsPermissionAllowed())) {
// await _drawOverAppsMessageDialog(context);
// return false;
// }
return true;
}
static Future<bool> askPenguinPermissions() async {
if (!(await Permission.location.request().isGranted) ||
!(await Permission.bluetooth.request().isGranted) ||
!(await Permission.bluetoothScan.request().isGranted) ||
!(await Permission.bluetoothConnect.request().isGranted) ||
!(await Permission.activityRecognition.request().isGranted)) {
return false;
}
return true;
}
}