Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prongbang/flutter_filex
A simple read & write file
https://github.com/prongbang/flutter_filex
flutter-read-file flutter-write-file read-file write-file
Last synced: 10 days ago
JSON representation
A simple read & write file
- Host: GitHub
- URL: https://github.com/prongbang/flutter_filex
- Owner: prongbang
- License: mit
- Created: 2021-09-23T12:43:29.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-03-15T08:48:58.000Z (almost 3 years ago)
- Last Synced: 2024-10-26T09:53:45.930Z (about 2 months ago)
- Topics: flutter-read-file, flutter-write-file, read-file, write-file
- Language: Dart
- Homepage: https://pub.dev/packages/flutter_filex
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# flutter_filex
A simple Read & Write file.
## Features
- Read & Write file
## Usage
```dart
final directoryUtility = TemporaryDirectoryUtility();
final directoryUtility = ApplicationDocumentsDirectoryUtility();
final directoryUtility = LibraryDirectoryUtility();
final directoryUtility = ApplicationSupportDirectoryUtility();
final directoryUtility = ExternalStorageDirectoryUtility();
final directoryUtility = DownloadsDirectoryUtility();final fileXUtility = FileXProvider.create(directoryUtility);
final fileX = FileX(
prefix: 'filex-',
filename: '1',
extension: FileX.png,
);// Read bytes
Uint8List contentByte = await fileXUtility.readAsBytes(fileX);// Read string
String contentString = await fileXUtility.readAsString(fileX);// Write bytes
String path1 = await fileXUtility.write(fileX..bytes = Uint8List.fromList([1, 0, 1]));// Write base64
String path2 = await fileXUtility.write(fileX..base64 = 'ZmlsZXg=');// Convert to File
File file = await fileXUtility.toFile(fileX);
```