Skip to content

Commit c6bc703

Browse files
mvanbeusekomMinyewoo
authored andcommitted
Make sure saveTo returns a Future (flutter#3363)
1 parent 745e041 commit c6bc703

5 files changed

Lines changed: 6 additions & 3 deletions

File tree

packages/cross_file/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2+
13
## 0.1.0+1
24

35
- Update Flutter SDK constraint.

packages/cross_file/lib/src/types/base.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ abstract class XFileBase {
1818
XFileBase(String path);
1919

2020
/// Save the CrossFile at the indicated file path.
21-
void saveTo(String path) async {
21+
Future<void> saveTo(String path) {
2222
throw UnimplementedError('saveTo has not been implemented.');
2323
}
2424

packages/cross_file/lib/src/types/html.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class XFile extends XFileBase {
108108

109109
/// Saves the data of this CrossFile at the location indicated by path.
110110
/// For the web implementation, the path variable is ignored.
111-
void saveTo(String path) async {
111+
Future<void> saveTo(String path) async {
112112
// Create a DOM container where we can host the anchor.
113113
_target = ensureInitialized('__x_file_dom_element');
114114

packages/cross_file/lib/src/types/io.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class XFile extends XFileBase {
5757
}
5858

5959
@override
60-
void saveTo(String path) async {
60+
Future<void> saveTo(String path) async {
6161
File fileToSave = File(path);
6262
await fileToSave.writeAsBytes(_bytes ?? (await readAsBytes()));
6363
await fileToSave.create();

packages/cross_file/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: cross_file
22
description: An abstraction to allow working with files across multiple platforms.
33
homepage: https://github.com/flutter/plugins/tree/master/packages/cross_file
4+
45
version: 0.1.0+1
56

67
dependencies:

0 commit comments

Comments
 (0)