getCamera static method
Returns the CameraDescription
of the camera that faces direction
.
Implementation
static Future<CameraDescription> getCamera(CameraLensDirection direction) async => await availableCameras().then(
(List<CameraDescription> cameras) => cameras.firstWhere(
(CameraDescription camera) => camera.lensDirection == direction,
),
);