handleAndGetFile method

Future<File?> handleAndGetFile(
  1. ImageEditorOption option,
  2. String targetPath
)

Implementation

Future<File?> handleAndGetFile(
  ImageEditorOption option,
  String targetPath,
) async {
  return _handle(() async {
    final String path;
    switch (_type) {
      case SrcType.file:
        path = await NativeChannel.fileToFile(
          _file!.path,
          option,
          targetPath,
        );
        break;
      case SrcType.memory:
        path = await NativeChannel.memoryToFile(_memory!, option, targetPath);
        break;
    }
    return File(path);
  });
}