isCameraAvailable method

Future<bool> isCameraAvailable(
  1. CameraLensDirection cameraLensDirection
)

Checks if a camera with the specified cameraLensDirection is available.

This method returns true if a camera matching the given direction is found, and false if no such camera is available.

Example usage:

bool isAvailable = await isCameraAvailable(CameraLensDirection.front);

Implementation

Future<bool> isCameraAvailable(CameraLensDirection cameraLensDirection) async {
  return await _getCameraBasedOnFacingType(cameraLensDirection) != null;
}