barback 0.15.2+14

  • Installing
  • Versions
  • 98

Barback is an asset build system. It is the library underlying pub's asset transformers in pub build and pub serve.

Given a set of input files and a set of transformations (think compilers, preprocessors and the like), it will automatically apply the appropriate transforms and generate output files. When inputs are modified, it automatically runs the transforms that are affected.

To learn more, see here.


  • Update code to eliminate Future flattening in Dart 2.0.


  • Enforce ordering of Futures with Future.microtask rather than async and await to account for upcoming behavior changes with async methods.


  • Declare support for async 2.0.0.


  • Update AssetNode.whenAvailable to be a generic method to fix a new strong mode error.


  • Update CancelableFuture to match the new Future.then type signature. The onValue parameter now has a return type of FutureOr<S> instead of S.


  • Fix all strong-mode warnings in Dart 1.18.


  • Fix all strong-mode warnings in Dart 1.16.


  • Add periodic fine-grained logging for long running transformers.


  • Fix a deadlock that occurred occasionally when a declaring transformer was followed by a lazy transformer (most commonly $dart2js).


  • If a transformer requests a non-existent asset from another package, it will now be re-run if that asset is later created.


  • Fix an incorrect example.


  • Clarify that a transform may emit any number of outputs.


  • Fix a bug in listing all assets from a static package.


  • Properly handle logs from a transformer that's been canceled.


  • Add a StaticPackageProvider class to more efficiently handle immutable, untransformed packages.


  • Widen the version constraint on the collection package.


  • Fully switch from source_maps' Span class to source_span's SourceSpan class.


  • All TransformLogger methods now accept SourceSpans from the source_span package in addition to Spans from the source_maps package. In 0.15.0, only SourceSpans will be accepted.


  • Add a dependency on the pool package.


  • Automatically log how long it takes long-running transforms to run.


  • Fix a bug where an event could be added to a closed stream.


  • Add an AggregateTransformer type. Aggregate transformers transform groups of assets for which no single asset is primary. For example, one could be used to merge all images in a directory into a single file.

  • Add a message getter to TransformerException and AssetLoadException.

  • Fix a bug where transformers would occasionally emit stale output after their inputs changed.


  • Properly handle synchronous errors in PackageProvider.getAsset().


  • Fix a bug with the previous bug fix.


  • Fix a bug where a transformer group preceded by another transformer group would sometimes fail to load secondary assets.


  • Breaking change: when an output of a lazy transformer is requested, that transformer will run long enough to generate the output, then become lazy again. Previously, it would become eager as soon as an asset had been requested.

  • Only run Transformer.isPrimary and Transformer.declareOutputs once for each asset.

  • Lazy transformers' laziness is preserved when followed by declaring transformers, or by normal transformers for which the lazy outputs aren't primary.

  • Fix a bug where reading the primary input using Transform.readInputAsString had slightly different behavior than reading it using Transform.primary.readAsString.

  • Fix a crashing bug when Barback.getAllAssets is called synchronously after creating a new Barback instance.

  • Don't warn if a lazy or declaring transformer doesn't emit outputs that it has declared. This is valid for transformers like dart2js that need to read their primary input in order to determine whether they should run.

  • Allow Transformer.isPrimary, Transformer.apply, and DeclaringTransformer.declareOutputs to return non-Future values if they run synchronously.

  • Fix a deadlock bug when a lazy primary input to a lazy transformer became dirty while the transformer's apply method was running.

  • Run declaring transformers with lazy inputs eagerly if the inputs become available.


  • Transformer.isPrimary now takes an AssetId rather than an Asset.

  • DeclaringTransform now only exposes the primary input's AssetId, rather than the primary Asset object.

  • DeclaringTransform no longer supports getInput, readInput, readInputAsString, or hasInput.


  • Add a Transform.logger.fine function that doesn't print its messages by default. When using Barback with pub in verbose mode, these messages will be printed.

  • Add a Transform.hasInput function that returns whether or not a given secondary input exists.

  • Transformer.allowedExtensions now supports extensions containing multiple periods, such as .dart.js.

  • Transforms now pass their primary inputs through to the next phase by default. A transformer may still overwrite its primary input without causing a collision. If a transformer doesn't overwrite its primary input, it may cause it not to be passed through by calling Transform.consumePrimary. The primary input will be consumed by default if a transformer throws an error.

  • If an input requested with Transform.getInput, Transform.readInput, or Transform.readInputAsString cannot be found, an AssetNotFoundException will be thrown. This was always what the documentation said, but previously a MissingInputException was thrown instead.

  • If a transformer calls Transform.logger.error, the transformer will now be considered to have failed after it finishes running apply(). This means that its outputs will not be consumed by future transformers and its primary input will not be passed through to the next phase.

  • If a transform calls Transform.getInput, Transform.readInput, Transform.readInputAsString, or Transform.hasInput on an input that doesn't exist, the transform will be re-run if that input is created in the future.

1. Depend on it

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

  barback: "^0.15.2+14"

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:barback/barback.dart';
Version Uploaded Documentation Archive
0.15.2+14 Jan 8, 2018 Go to the documentation of barback 0.15.2+14 Download barback 0.15.2+14 archive
0.15.2+13 Oct 5, 2017 Go to the documentation of barback 0.15.2+13 Download barback 0.15.2+13 archive
0.15.2+12 Sep 22, 2017 Go to the documentation of barback 0.15.2+12 Download barback 0.15.2+12 archive
0.15.2+11 May 3, 2017 Go to the documentation of barback 0.15.2+11 Download barback 0.15.2+11 archive
0.15.2+10 Mar 23, 2017 Go to the documentation of barback 0.15.2+10 Download barback 0.15.2+10 archive
0.15.2+9 Aug 8, 2016 Go to the documentation of barback 0.15.2+9 Download barback 0.15.2+9 archive
0.15.2+8 May 17, 2016 Go to the documentation of barback 0.15.2+8 Download barback 0.15.2+8 archive
0.15.2+7 Sep 18, 2015 Go to the documentation of barback 0.15.2+7 Download barback 0.15.2+7 archive
0.15.2+6 Jul 27, 2015 Go to the documentation of barback 0.15.2+6 Download barback 0.15.2+6 archive
0.15.2+5 Jul 20, 2015 Go to the documentation of barback 0.15.2+5 Download barback 0.15.2+5 archive

All 79 versions...


This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1


Describes how popular the package is relative to other packages. [more]
97 / 100
Code health derived from static analysis. [more]
100 / 100
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]


Detected platforms: Flutter, other

Primary library: package:barback/barback.dart with components: io, build.


  • 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.

  • The description is too long.

    Search engines will display only the first part of the description. Try to keep it under 180 characters.

  • Maintain an example.

    None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use barback.dart.

  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.22.0 <2.0.0
async >=1.10.0 <3.0.0 2.0.3
collection ^1.5.0 1.14.5
path >=0.9.0 <2.0.0 1.5.1
pool >=1.0.0 <2.0.0 1.3.4
source_span >=1.0.0 <2.0.0 1.4.0
stack_trace >=0.9.1 <2.0.0 1.9.1
Transitive dependencies
charcode 1.1.1
Dev dependencies
scheduled_test >=0.9.0 <0.11.0
unittest >=0.9.0 <0.10.0