Skip to content

Commit e90be03

Browse files
committed
rollback resource loader
1 parent feb560b commit e90be03

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lib/resource_loader.dart

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,20 @@ import 'package:pub_cache/pub_cache.dart';
2424
String packageRootPath;
2525

2626
/// Loads a `package:` resource as a String.
27-
Future<String> loadAsString(String path) {
27+
Future<String> loadAsString(String path) async {
2828
if (!path.startsWith('package:')) {
2929
throw new ArgumentError('path must begin with package:');
3030
}
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);
3433
}
3534

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) {
3837
if (!path.startsWith('package:')) {
3938
throw new ArgumentError('path must begin with package:');
4039
}
41-
return new Resource(path).readAsBytes();
40+
return _doLoad(path);
4241
}
4342

4443
/// Determine how to do the load. HTTP? Snapshotted? From source?

0 commit comments

Comments
 (0)