commit | da5c201dfe8adde920a60bbd6319e779c961d45b | [log] [tgz] |
---|---|---|
author | John Messerly <jmesserly@google.com> | Wed Mar 09 10:53:29 2016 -0800 |
committer | John Messerly <jmesserly@google.com> | Wed Mar 09 10:53:29 2016 -0800 |
tree | 3adf38edf462426f75d5dc3e8f66fc3337bf878c | |
parent | 14b94b757a4f2b6c2aabf70da7a590d6e7b7c425 [diff] |
Update README.md Syntax highlighting for Dart code block :)
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.