hasPermission method

  1. @override
Future<bool?> hasPermission()
override

Implementation

@override
Future<bool?> hasPermission() async {
  bool? status;
  try {
    final cameras = await availableCameras();
    if (cameras.isNotEmpty) {
      status = true;
    } else {
      status = null;
    }
    return status;
  } catch (error) {
    status = false;
    return status;
  }
}