open static method

Future<Camera> open(
  1. int cameraId
)

Creates a new Camera object to access a particular hardware camera.

If the same camera is opened by other applications, this will throw a PlatformException.

You must call release when you are done using the camera, otherwise it will remain locked and be unavailable to other applications. Your application should only have one Camera object active at a time for a particular hardware camera.

Throws a PlatformException if opening the camera fails (for example, if the camera is in use by another process or device policy manager has disabled the camera).

See: getAllCameraInfo

Implementation

static Future<Camera> open(int cameraId) async {
  return await _channel.$open(cameraId) as Camera;
}