captureImage method

void captureImage()

Implementation

void captureImage() async {
  final CameraController? cameraController = value.cameraController;
  try {
    cameraController!.stopImageStream().whenComplete(() async {
      takePicture().then((XFile? file) async {
        /// Return image callback
        if (file != null) {
          final uint8List = await FaceIdentifier.cropedImage(File(file.path));
          onCapture.call(File(file.path), uint8List);
        }
      });
    });
  } catch (e) {
    logError(e.toString());
  }
}