commit | 6b79867d0becf5395e5819a75720963b8298e9a7 | [log] [tgz] |
---|---|---|
author | Lasse R.H. Nielsen <lrn@google.com> | Fri Jun 26 10:40:46 2020 |
committer | GitHub <noreply@github.com> | Fri Jun 26 10:40:46 2020 |
tree | ee1e6c467188baa9d7bd679d36362453e409655a | |
parent | d3c872a24e5474af4bd71c8d62e96f5b42e4997f [diff] |
Deprecate (#49) Deprecate the package.
NOTICE This package is discontinued. It will not be maintained or upgraded in the future.
This package combines two functionalities:
package:
URI to a platform specific URI (usually http:
or file:
, depending on the platform)The former no longer makes sense when a large number of Dart programs are ahead-of-time compiled. Those programs do not have access to source files at runtime, and a package:
URI references a source file. There is no standard way to find a runtime location of a source file, or even ensure that it is available.
The platform specific loading functionality can still be useful. However, without a way to produce such platform specific URIs from platform independent ones, the only URIs which can still be loaded on all platforms are http:
/https:
ones. Loading those is better supported by the http
package.
As such, this package can no longer supports its original goal, being a cross platform resource loading solution. It will be discontinued rather than provide an inadequate solution.
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(encoding: utf8); print(string); }
Please check out the API docs.
Please file feature requests and bugs at the issue tracker.