flutter_media_scanner 0.0.10
flutter_media_scanner: ^0.0.10 copied to clipboard

Flutter Android

Refresh the filesystem after writing a file to Android Gallery

flutter_media_scanner #

Use this plugin to refresh the filesystem after writing a file

Example #

Scaffold(
        appBar: AppBar(
          title: const Text('FlutterMediaScanner example'),
        ),
        body: Center(
          child: OutlineButton(
            onPressed: () async {
              File originalFile = File("original path");
              List<int> bytes = await originalFile.readAsBytes();
              //save your file to your desired path
              File file = File("path");
              await file.writeAsBytes(bytes);
              //refresh the file system so the file can show there,
              await FlutterMediaScanner.scan(file.path);
            },
            child: const Text("Save & refresh!"),
          ),
        ),
)
1
likes
80
pub points
17%
popularity

Refresh the filesystem after writing a file to Android Gallery

Homepage

Documentation

API reference

Uploader

mybotstory@gmail.com

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_media_scanner