data_assets 0.19.3 copy "data_assets: ^0.19.3" to clipboard
data_assets: ^0.19.3 copied to clipboard

This library contains the hook protocol specification for bundling data assets with Dart packages.

package:data_assets Coverage Status pub package package publisher

A library to use in build hooks (hook/build.dart) for building and bundling data assets.

A data asset is an asset bundled as data (String or bytes) with a Dart or Flutter application.

Data assets can be added in a build hook as follows:

import 'package:data_assets/data_assets.dart';
import 'package:hooks/hooks.dart';

void main(List<String> args) async {
  await build(args, (input, output) async {
    final packageName = input.packageName;
    final assetPath = input.outputDirectory.resolve('...');

    output.assets.data.add(
      DataAsset(package: packageName, name: '...', file: assetPath),
    );
  });
}

For more documentation of hooks, refer to the API docs of package:hooks.

Status: Experimental #

NOTE: This package is currently experimental and published under the labs.dart.dev pub publisher in order to solicit feedback.

For packages in the labs.dart.dev publisher we generally plan to either graduate the package into a supported publisher (dart.dev, tools.dart.dev) after a period of feedback and iteration, or discontinue the package. These packages have a much higher expected rate of API and breaking changes.

Your feedback is valuable and will help us evolve this package. For bugs, please file an issue in the bug tracker.

11
likes
160
points
211k
downloads

Publisher

verified publisherlabs.dart.dev

Weekly Downloads

This library contains the hook protocol specification for bundling data assets with Dart packages.

Repository (GitHub)
Contributing

Topics

#assets #hooks

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

hooks

More

Packages that depend on data_assets