takePhoto method

Future<void> takePhoto()

Implementation

Future<void> takePhoto() async {
  if (!value.isInitialized || _isDisposed!) {
    throw CameraException(
      'Uninitialized CameraController',
      'takePhoto was called on uninitialized CameraController',
    );
  }
  if (value.isRecordingVideo) {
    throw CameraException(
      'A video recording is already started.',
      'takePhoto was called when a recording is already started.',
    );
  }
  try {
    await _channel.invokeMethod<void>('takePhoto');
    // return data;
  } on PlatformException catch (e) {
    throw CameraException(e.code, e.message!);
  }
}