commit | de5699c6b261272eb390d86f0a1d9fee567e79e6 | [log] [tgz] |
---|---|---|
author | stuartmorgan <stuartmorgan@google.com> | Wed Feb 24 20:17:34 2021 -0800 |
committer | GitHub <noreply@github.com> | Wed Feb 24 20:17:34 2021 -0800 |
tree | da9196e98851d5a2240997a074499fa50599a4c4 | |
parent | a826d645724bc1258be16349b6f8c21de74e322d [diff] |
[cross_file] Fix base class nullability (#3629) Without this, the dummy ("interface") XFile implementation of these properties has different nullability than the others, and the analyzer doesn't match what the runtime actually sees.
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.