scan method

Future scan (
  1. String path
)

path is the file path Here is an example:

File originalFile = File("path/to/file");
List<int> bytes = await originalFile.readAsBytes();
save your file to your desired path
File file = File("desired/path");
await file.writeAsBytes(bytes);
refresh the file system so the file can show in the gallery,
await FlutterMediaScanner.scan(file.path);

Implementation

static Future scan(String path) async {
  if (Platform.isAndroid) {
    await _channel.invokeMethod('scan', {"path": path});
  }
  return;
}