flutter-clutter / flutter-simple-edge-detection

A Flutter plugin enabling the user to detect edges of a given image. It returns the relative coordinates of the detection rectangle.
71 stars 47 forks source link

Update scan.dart - takePicture() function has no parameters #23

Closed thomaslc66 closed 1 year ago

thomaslc66 commented 3 years ago

Seems like takePicutre from CameraController does not take a parameter:

  /// Captures an image and returns the file where it was saved.
  ///
  /// Throws a [CameraException] if the capture fails.
  Future<XFile> takePicture() async {
    _throwIfNotInitialized("takePicture");
    if (value.isTakingPicture) {
      throw CameraException(
        'Previous capture has not returned yet.',
        'takePicture was called before the previous capture returned.',
      );
    }
    try {
      value = value.copyWith(isTakingPicture: true);
      XFile file = await CameraPlatform.instance.takePicture(_cameraId);
      value = value.copyWith(isTakingPicture: false);
      return file;
    } on PlatformException catch (e) {
      value = value.copyWith(isTakingPicture: false);
      throw CameraException(e.code, e.message);
    }
  }
thomaslc66 commented 3 years ago

Sorry didn't get that the camera version was not the last one.