commit | 623c5156733b686797a60ae163ba17e2c7b2ffd3 | [log] [tgz] |
---|---|---|
author | Maurits van Beusekom <maurits@baseflow.com> | Wed Nov 18 09:04:06 2020 +0100 |
committer | GitHub <noreply@github.com> | Wed Nov 18 09:04:06 2020 +0100 |
tree | fc5782f9743c343a95a427c55fc191f4c2ae451f |
[cross_file] An abstraction to allow working with files across multiple platforms. (#3260) * Initial version of x_file package * Renamed from x_file to cross_file * Add back x_file type to file_selector * Fix formatting issues * Update homepage and version * Added README.md * Added missing copyright * Revert "Added missing copyright" This reverts commit cf7e8d5f3810ae646669f584738502a8cc3c5ca1. * Add missing copyright Co-Authored-By: Jason Panelli <38673809+jasonpanelli@users.noreply.github.com> * Renamed class implementation back to XFile * Fix formatting issues * Rename to cross_file * Added code owners for cross_file package Co-authored-by: Jason Panelli <38673809+jasonpanelli@users.noreply.github.com>
An abstraction to allow working with files across multiple platforms.
Import package:cross/cross_info.dart
, instantiate a CrossFile
using a path or byte array and use its methods and properties to access the file and its metadata.
Example:
import 'package:cross_file/cross_file.dart'; final file = CrossFile('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.
For help getting started with Flutter, view our online documentation.
For help on editing plugin code, view the documentation.