simple_file_saver 2.0.1 copy "simple_file_saver: ^2.0.1" to clipboard
simple_file_saver: ^2.0.1 copied to clipboard

Plugin that allows you to save files to a public or shared directory such as the Downloads folder in Android and Files in iOS.

simple_file_saver #

pub package

A Flutter plugin that allows you to save files to a public or shared directory such as the Downloads folder in Android and Files in iOS.

Usage #

To use this plugin, add simple_file_saver as a dependency in your pubspec.yaml file.

Example #

final result = await SimpleFileSaver.saveFile(
    fileInfo: FileSaveInfo.fromBytes(
        bytes: utf8.encode('This file is saved to the default directory'),
        basename: 'file_save',
        extension: 'txt',
    ),
);

final result = await SimpleFileSaver.saveFile(
    fileInfo: FileSaveInfo.fromBytes(
        bytes: utf8.encode('This file is saved to the user picked directory'),
        basename: 'file_save_as',
        extension: 'txt',
    ),
    saveAs: true,
);

SimpleFileSaver.downloadLinkBuilder(
    fileInfo: FileSaveInfo.fromUrl(
        url: 'https://picsum.photos/id/237/200/300',
        basename: 'test_file_dl',
        extension: 'jpg',
    ),
    builder: (_, startDownload) => TextButton(
        child: const Text('Download by Uri (from remote)'),
        onPressed: () async {
            startDownload.call();
        },
    ),
),
2
likes
160
pub points
66%
popularity

Publisher

unverified uploader

Plugin that allows you to save files to a public or shared directory such as the Downloads folder in Android and Files in iOS.

Homepage
Repository (GitHub)
View/report issues

Topics

#files #save-file #file-saver

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, simple_file_saver_android, simple_file_saver_ios, simple_file_saver_platform_interface, simple_file_saver_web

More

Packages that depend on simple_file_saver