commit | ac8c91e9d9863eb14dc7604b0d9914103e5103df | [log] [tgz] |
---|---|---|
author | Kevin Moore <kevmoo@google.com> | Sat Feb 06 15:49:44 2016 -0800 |
committer | Kevin Moore <kevmoo@google.com> | Sat Feb 06 15:49:44 2016 -0800 |
tree | 7d10b2b5ceefacfac5516718717bdbb911434e39 | |
parent | 2344bf9a9326ea8a62d5bd03e7e9817c6c9fc51b [diff] |
Fix library name of browser_resource closes https://github.com/dart-lang/resource/issues/10 R=lrn@google.com Review URL: https://codereview.chromium.org//1657173004 .
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.