Use configurable imports to avoid having two versions of everything.

R=floitsch@google.com

Review URL: https://codereview.chromium.org//2353933002 .

Committed: https://github.com/dart-lang/resource/commit/f1c6229ffdb33a7f274fa819ebe5f0ca493ba3c5
Committed: https://github.com/dart-lang/resource/commit/799a627d802b42b244273c35b67f3504ea83f008
1 file changed
tree: b3c63acdf18cbc2bc989608e1b9e3c0de936b0ae
  1. .gitignore
  2. .test_config
  3. .travis.yml
  4. AUTHORS
  5. CHANGELOG.md
  6. CONTRIBUTING.md
  7. LICENSE
  8. README.md
  9. codereview.settings
  10. lib/
  11. pubspec.yaml
  12. test/
  13. tool/
README.md

Resource

Reading data from package contents and files.

A resource is data that can be read into a Dart program at runtime. A resource is identified by a URI. It can be loaded as bytes or data. The resource URI may be a package: URI.

Example:

import 'package:resource/resource.dart' show Resource;
import 'dart:convert' show UTF8;

main() async {
  var resource = new Resource("package:foo/foo_data.txt");
  var string = await resource.readAsString(UTF8);
  print(string);
}

Learning more

Please check out the API docs.

Features and bugs

The current version of resource.dart depends on the dart:io library, and doesn't work in the browser. Use package:resource/browser_resource.dart in the browser until further notice.

Please file feature requests and bugs at the issue tracker.