scan method

Future scan (
  1. String filePath
)

Here is an example:

File originalFile = File("path/to/file");
List<int> bytes = await originalFile.readAsBytes();
File file = File("desired/path");
await file.writeAsBytes(bytes);
await FlutterMediaScanner.scan(file.path);

Now the saved file shoud appear in the gallery

Implementation

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