File tree 5 files changed +8
-4
lines changed 5 files changed +8
-4
lines changed Original file line number Diff line number Diff line change
1
+ ## 0.2.0
2
+
3
+ * ** breaking change** Make sure the ` saveTo ` method returns a ` Future ` so it can be awaited and users are sure the file has been written to disk.
4
+
1
5
## 0.1.0+2
2
6
3
7
* Fix outdated links across a number of markdown files ([ #3276 ] ( https://github.com/flutter/plugins/pull/3276 ) )
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ abstract class XFileBase {
18
18
XFileBase (String path);
19
19
20
20
/// Save the CrossFile at the indicated file path.
21
- void saveTo (String path) async {
21
+ Future < void > saveTo (String path) {
22
22
throw UnimplementedError ('saveTo has not been implemented.' );
23
23
}
24
24
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ class XFile extends XFileBase {
108
108
109
109
/// Saves the data of this CrossFile at the location indicated by path.
110
110
/// For the web implementation, the path variable is ignored.
111
- void saveTo (String path) async {
111
+ Future < void > saveTo (String path) async {
112
112
// Create a DOM container where we can host the anchor.
113
113
_target = ensureInitialized ('__x_file_dom_element' );
114
114
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ class XFile extends XFileBase {
57
57
}
58
58
59
59
@override
60
- void saveTo (String path) async {
60
+ Future < void > saveTo (String path) async {
61
61
File fileToSave = File (path);
62
62
await fileToSave.writeAsBytes (_bytes ?? (await readAsBytes ()));
63
63
await fileToSave.create ();
Original file line number Diff line number Diff line change 1
1
name : cross_file
2
2
description : An abstraction to allow working with files across multiple platforms.
3
3
homepage : https://github.com/flutter/plugins/tree/master/packages/cross_file
4
- version : 0.1.0+2
4
+ version : 0.2.0
5
5
6
6
dependencies :
7
7
flutter :
You can’t perform that action at this time.
0 commit comments