Skip to content

Commit 919eaef

Browse files
authored
[cross_file] Use Uri when calling package:http methods (flutter#3462)
The next version of package:http expects URIs. See dart-lang/http#507
1 parent 207d129 commit 919eaef

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

packages/cross_file/CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.2.1
2+
3+
* Prepare for breaking `package:http` change.
4+
15
## 0.2.0
26

37
* **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.
@@ -12,4 +16,4 @@
1216

1317
## 0.1.0
1418

15-
- Initial open-source release
19+
- Initial open-source release

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
// found in the LICENSE file.
44

55
import 'dart:convert';
6+
import 'dart:html';
67
import 'dart:typed_data';
78

89
import 'package:http/http.dart' as http show readBytes;
910
import 'package:meta/meta.dart';
10-
import 'dart:html';
1111

12-
import '../web_helpers/web_helpers.dart';
1312
import './base.dart';
13+
import '../web_helpers/web_helpers.dart';
1414

1515
/// A CrossFile that works on web.
1616
///
@@ -82,7 +82,7 @@ class XFile extends XFileBase {
8282
if (_data != null) {
8383
return Future.value(UnmodifiableUint8ListView(_data));
8484
}
85-
return http.readBytes(path);
85+
return http.readBytes(Uri.parse(path));
8686
}
8787

8888
@override

packages/cross_file/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +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-
version: 0.2.0
4+
version: 0.2.1
55

66
dependencies:
77
flutter:

0 commit comments

Comments
 (0)