inline_assets 0.1.2 copy "inline_assets: ^0.1.2" to clipboard
inline_assets: ^0.1.2 copied to clipboard

Dart 1 only

Transformer that inlines asset file contents as strings in Dart source code.

inline_assets.dart #

Transformer that inlines asset files into Dart source files as strings.

Build Status

Usage #

Add the inline_assets transformer to the transformer list in your pubspec.yaml:

transformers:
  - inline_assets

This transformer substitutes INLINE_ASSET("uri") placeholders with the contents of the asset they reference. The uri should be a valid Dart URI. It may be a relative URI or a package: URI:

// my_package|lib/my_lib.dart

// Import the INLINE_ASSET placeholder function
import 'package:inline_assets/inline_assets.dart';

// Will be set to the contents of my_package|lib/queries/my_query.sql
String query = INLINE_ASSET('queries/my_query.sql');

// Will be set to the contents of other|lib/shaders/some_shader.glsl
String shader = INLINE_ASSET('package:other/shaders/some_shader.glsl');

Absolute URIs are not allowed.

0
likes
30
pub points
0%
popularity

Publisher

unverified uploader

Transformer that inlines asset file contents as strings in Dart source code.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

barback, code_transformers, source_span

More

Packages that depend on inline_assets