saveFile static method

Future<String?> saveFile(
  1. String key,
  2. Uint8List bytes, {
  3. String extension = 'png',
})

Writes bytes into shared storage and returns the absolute path.

That path is what MFileImage expects. Without this the DSL could name a file the app had no supported way to put there.

Implementation

static Future<String?> saveFile(
  String key,
  Uint8List bytes, {
  String extension = 'png',
}) async {
  return _channel.invokeMethod<String>('saveFile', {
    'key': key,
    'bytes': bytes,
    'extension': extension,
    'appGroupId': _appGroupId,
  });
}