save method

Future<File> save(
  1. String path
)

Saves the file to the provided filesystem path.

Returns the written File.

Example:

final saved = await file.save('/tmp/avatar.png');
print(saved.path);

Implementation

Future<File> save(String path) async {
  final file = File(path);
  final bytes = await _cachedBytes;
  await file.writeAsBytes(bytes);
  return file;
}