Skip to content

Commit

Permalink
[cross_file] Use Uri when calling package:http methods (flutter#3462)
Browse files Browse the repository at this point in the history
The next version of package:http expects URIs. See dart-lang/http#507
  • Loading branch information
grouma authored and adsonpleal committed Feb 26, 2021
1 parent 0dbc30b commit 6f76f72
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion packages/cross_file/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.2.1

* Prepare for breaking `package:http` change.

## 0.2.0

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

## 0.1.0

- Initial open-source release
- Initial open-source release
6 changes: 3 additions & 3 deletions packages/cross_file/lib/src/types/html.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
// found in the LICENSE file.

import 'dart:convert';
import 'dart:html';
import 'dart:typed_data';

import 'package:http/http.dart' as http show readBytes;
import 'package:meta/meta.dart';
import 'dart:html';

import '../web_helpers/web_helpers.dart';
import './base.dart';
import '../web_helpers/web_helpers.dart';

/// A CrossFile that works on web.
///
Expand Down Expand Up @@ -82,7 +82,7 @@ class XFile extends XFileBase {
if (_data != null) {
return Future.value(UnmodifiableUint8ListView(_data));
}
return http.readBytes(path);
return http.readBytes(Uri.parse(path));
}

@override
Expand Down
2 changes: 1 addition & 1 deletion packages/cross_file/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: cross_file
description: An abstraction to allow working with files across multiple platforms.
homepage: https://github.com/flutter/plugins/tree/master/packages/cross_file
version: 0.2.0
version: 0.2.1

dependencies:
flutter:
Expand Down

0 comments on commit 6f76f72

Please sign in to comment.