Skip to content

Commit 91499f3

Browse files
committed
Added README.md
1 parent cc9f3da commit 91499f3

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

packages/cross_file/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# cross_file
2+
3+
An abstraction to allow working with files across multiple platforms.
4+
5+
# Usage
6+
7+
Import `package:cross/cross_info.dart`, instantiate a `CrossFile`
8+
using a path or byte array and use its methods and properties to
9+
access the file and its metadata.
10+
11+
Example:
12+
13+
```dart
14+
import 'package:cross_file/cross_file.dart';
15+
16+
final file = CrossFile('assets/hello.txt');
17+
18+
print('File information:');
19+
print('- Path: ${file.path}');
20+
print('- Name: ${file.name}');
21+
print('- MIME type: ${file.mimeType}');
22+
23+
final fileContent = await file.readAsString();
24+
print('Content of the file: ${fileContent}'); // e.g. "Moto G (4)"
25+
```
26+
27+
You will find links to the API docs on the [pub page](https://pub.dartlang.org/packages/cross_file).
28+
29+
## Getting Started
30+
31+
For help getting started with Flutter, view our online
32+
[documentation](http://flutter.io/).
33+
34+
For help on editing plugin code, view the [documentation](https://flutter.io/platform-plugins/#edit-code).

0 commit comments

Comments
 (0)