getCameraController function

Future<CameraController> getCameraController()

Implementation

Future<CameraController> getCameraController() async {
  final cameraDescription = (await availableCameras())
      .where(
        (element) => element.lensDirection == CameraLensDirection.front,
      )
      .first;

  return CameraController(cameraDescription, ResolutionPreset.high,
      enableAudio: false,
      imageFormatGroup:
          Platform.isIOS ? ImageFormatGroup.bgra8888 : ImageFormatGroup.yuv420);
}