Clone this repo:
  1. d012b2c Fix bug in `readAsBytes` via http when content-length is set. (#24) by Jason Daly · 3 weeks ago master
  2. 3b1ee7b Fix bug in readAsString when charset is LATIN-1 and content-length is set. by Lasse Reichstein Holst Nielsen · 5 months ago
  3. 15728b5 Address a number of open issues. by Lasse R.H. Nielsen · 5 months ago
  4. 39d3a2a Make failing HTTP requests thrown when using dart:io. by Lasse R.H. Nielsen · 5 months ago
  5. 0ffc9c5 Update by Lasse R.H. Nielsen · 9 months ago 2.0.2


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.


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(encoding: UTF8);

Learning more

Please check out the API docs.

Features and bugs

Please file feature requests and bugs at the issue tracker.