memoryToFile static method

Future<String> memoryToFile(
  1. Uint8List memory,
  2. ImageEditorOption option,
  3. String targetPath
)

Handle memory source and get file result.

Implementation

static Future<String> memoryToFile(
  Uint8List memory,
  ImageEditorOption option,
  String targetPath,
) async {
  if (option.options.isEmpty || option.canIgnore) {
    return (File(targetPath)..writeAsBytesSync(memory)).path;
  }
  return await channel.invokeMethod('memoryToFile', {
    'image': memory,
    'target': targetPath,
    'options': option.toJson(),
    'fmt': option.outputFormat.toJson(),
  });
}