Skip to content

biancashouse/file_access

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

file_access

An abstract way to handle files on iOS, Android, Desktop and Web!

Online Demo: https://rodydavis.github.io/file_access/

Installing:

dependencies:
  flutter:
    sdk: flutter
  file_access:
    git: https://github.com/rodydavis/file_access

Setup

Web

Add the following line to your body to make it work in Safari:

<input type="file" style="visibility:hidden;" id="file-picker" />

IOS

https://github.com/miguelpruivo/flutter_file_picker/wiki/Setup#ios

Getting Started

Pick a file:

final _file = await openFile();

Select multiple files:

final _files = await openFiles();

Pick an image:

final _file = await pickImage();

Pick a video:

final _file = await pickVideo();

Once you have the FileX type you can read the data:

final _bytes = await _file.readAsBytes();
final _string = await _file.readAsString();

Creating a new file:

final _file = FileX('path/to/file/file.txt');
await _file.writeAsString('My New Data!');
final _output = await _file.readAsString();
print(_output); // 'My New Data!'

About

File.io for Web, Desktop and Mobile for Flutter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 60.3%
  • Ruby 27.5%
  • Swift 5.9%
  • HTML 5.5%
  • Other 0.8%