File tree 1 file changed +6
-7
lines changed 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -24,21 +24,20 @@ import 'package:pub_cache/pub_cache.dart';
24
24
String packageRootPath;
25
25
26
26
/// Loads a `package:` resource as a String.
27
- Future <String > loadAsString (String path) {
27
+ Future <String > loadAsString (String path) async {
28
28
if (! path.startsWith ('package:' )) {
29
29
throw new ArgumentError ('path must begin with package:' );
30
30
}
31
- return new Resource (path).readAsString ();
32
- // Uint8List bytes = await _doLoad(path);
33
- // return new String.fromCharCodes(bytes);
31
+ Uint8List bytes = await _doLoad (path);
32
+ return new String .fromCharCodes (bytes);
34
33
}
35
34
36
- /// Loads a `package:` resource as an [List<int> ] .
37
- Future <List < int > > loadAsBytes (String path) {
35
+ /// Loads a `package:` resource as an [Uint8List ] .
36
+ Future <Uint8List > loadAsBytes (String path) {
38
37
if (! path.startsWith ('package:' )) {
39
38
throw new ArgumentError ('path must begin with package:' );
40
39
}
41
- return new Resource (path). readAsBytes ( );
40
+ return _doLoad (path);
42
41
}
43
42
44
43
/// Determine how to do the load. HTTP? Snapshotted? From source?
You can’t perform that action at this time.
0 commit comments