File tree 1 file changed +34
-0
lines changed
1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change
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 ) .
You can’t perform that action at this time.
0 commit comments