inline_assets 0.1.2

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 47

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.

inline_assets.dart change log

0.1.0

  • Initial version

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  inline_assets: "^0.1.2"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:inline_assets/inline_assets.dart';
        
Version Uploaded Documentation Archive
0.1.2 Sep 14, 2016 Go to the documentation of inline_assets 0.1.2 Download inline_assets 0.1.2 archive
0.1.1 Aug 30, 2016 Go to the documentation of inline_assets 0.1.1 Download inline_assets 0.1.1 archive
0.1.0 Aug 30, 2016 Go to the documentation of inline_assets 0.1.0 Download inline_assets 0.1.0 archive

Analysis

We analyzed this package on Apr 9, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.46.0
  • pana: 0.10.6

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
19 / 100
Health:
Code health derived from static analysis. [more]
97 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
43 / 100
Overall score:
Weighted score of the above. [more]
47
Learn more about scoring.

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:inline_assets/inline_assets.dart.

Suggestions

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use inline_assets.dart.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 2 hints.

    Strong-mode analysis of lib/transformer.dart gave the following hint:

    line: 3 col: 1
    'barback' is deprecated and shouldn't be used.

  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.0.0 <2.0.0
barback >=0.15.2 <0.16.0 0.15.2+15
code_transformers >=0.4.2 <0.5.0 0.4.2+4 0.5.1+4
source_span >=1.2.3 <2.0.0 1.4.0
Transitive dependencies
analyzer 0.29.11 0.31.1
args 0.13.7 1.4.1
async 2.0.6
charcode 1.1.1
cli_util 0.0.1+2 0.1.2+1
collection 1.14.9
convert 2.0.1
crypto 2.0.2+1
csslib 0.14.1
glob 1.1.5
html 0.13.3
isolate 1.1.0 2.0.0
logging 0.11.3+1
meta 1.1.2
package_config 1.0.3
path 1.5.1
plugin 0.2.0+2
pool 1.3.4
source_maps 0.10.4
stack_trace 1.9.2
string_scanner 1.0.2
typed_data 1.1.5
utf 0.9.0+4
watcher 0.9.7+7
when 0.2.0
which 0.1.3
yaml 2.1.13
Dev dependencies
test >=0.12.0 <0.13.0
transformer_test >=0.2.1 <0.3.0