commit | f1c6229ffdb33a7f274fa819ebe5f0ca493ba3c5 | [log] [tgz] |
---|---|---|
author | Lasse R.H. Nielsen <lrn@google.com> | Fri Sep 23 13:53:22 2016 +0200 |
committer | Lasse R.H. Nielsen <lrn@google.com> | Fri Sep 23 13:53:22 2016 +0200 |
tree | 5735b3e8862b5761c20fe3d8e2a7e76aa400a5ac | |
parent | da5c201dfe8adde920a60bbd6319e779c961d45b [diff] |
Use configurable imports to avoid having two versions of everything. R=floitsch@google.com Review URL: https://codereview.chromium.org//2353933002 .
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); }
Please check out the API docs.
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.