Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rodydavis/file_access
File.io for Web, Desktop and Mobile for Flutter
https://github.com/rodydavis/file_access
file files flutter image video
Last synced: 20 days ago
JSON representation
File.io for Web, Desktop and Mobile for Flutter
- Host: GitHub
- URL: https://github.com/rodydavis/file_access
- Owner: rodydavis
- License: other
- Created: 2020-03-18T00:26:02.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-09-27T18:07:41.000Z (about 3 years ago)
- Last Synced: 2024-10-03T07:42:48.653Z (about 1 month ago)
- Topics: file, files, flutter, image, video
- Language: Dart
- Homepage: https://rodydavis.github.io/file_access/
- Size: 1.73 MB
- Stars: 58
- Watchers: 4
- Forks: 11
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# file_access
An abstract way to handle files on iOS, Android, Desktop and Web!
Online Demo: https://rodydavis.github.io/file_access/
Installing:
```yaml
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:
```html
```
### IOS
https://github.com/miguelpruivo/flutter_file_picker/wiki/Setup#ios
## Getting Started
Pick a file:
```dart
final _file = await openFile();```
Select multiple files:
```dart
final _files = await openFiles();```
Pick an image:
```dart
final _file = await pickImage();```
Pick a video:
```dart
final _file = await pickVideo();```
Once you have the `FileX` type you can read the data:
```dart
final _bytes = await _file.readAsBytes();
final _string = await _file.readAsString();
```Creating a new file:
```dart
final _file = FileX('path/to/file/file.txt');
await _file.writeAsString('My New Data!');
final _output = await _file.readAsString();
print(_output); // 'My New Data!'
```