https://github.com/redsolver/cross_file_dart
An abstraction to allow working with files across multiple platforms. (Dart-only)
https://github.com/redsolver/cross_file_dart
Last synced: about 1 year ago
JSON representation
An abstraction to allow working with files across multiple platforms. (Dart-only)
- Host: GitHub
- URL: https://github.com/redsolver/cross_file_dart
- Owner: redsolver
- License: bsd-3-clause
- Created: 2021-07-12T17:17:48.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-10-08T19:54:47.000Z (over 4 years ago)
- Last Synced: 2025-01-26T11:11:12.624Z (over 1 year ago)
- Language: Dart
- Size: 13.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Authors: AUTHORS
Awesome Lists containing this project
README
# cross_file_dart
An abstraction to allow working with files across multiple platforms.
# Usage
Import `package:cross_file_dart/cross_file_dart.dart`, instantiate a `CrossFile`
using a path or byte array and use its methods and properties to
access the file and its metadata.
Example:
```dart
import 'package:cross_file_dart/cross_file_dart.dart';
final file = XFileDart('assets/hello.txt');
print('File information:');
print('- Path: ${file.path}');
print('- Name: ${file.name}');
print('- MIME type: ${file.mimeType}');
final fileContent = await file.readAsString();
print('Content of the file: ${fileContent}'); // e.g. "Moto G (4)"
```
You will find links to the API docs on the [pub page](https://pub.dev/packages/cross_file).