fileToMemory static method

Future<Uint8List> fileToMemory(
  1. String path,
  2. ImageEditorOption option
)

Handle file source and get momory result.

Implementation

static Future<Uint8List> fileToMemory(
  String path,
  ImageEditorOption option,
) async {
  if (option.options.isEmpty || option.canIgnore) {
    return File(path).readAsBytesSync();
  }

  return await channel.invokeMethod('fileToMemory', {
    'src': path,
    'options': option.toJson(),
    'fmt': option.outputFormat.toJson(),
  });
}