build_version 2.0.1

Pub Build Status

Include the version of your package in our source code.

  1. Add build_version to pubspec.yaml. Also make sure there is a version field.

     name: my_pkg
     version: 1.2.3
       build_runner: ^1.0.0
       build_version: ^2.0.0
  2. Run a build.

     > pub run build_runner build

    lib/src/version.dart will be generated with content:

     // Generated code. Do not modify.
     const packageVersion = '1.2.3';

2.0.1 #

  • Support the latest package:build_config.

2.0.0 #

  • The builder now runs when build_version is a dependency. build.yaml changes are no longer required.

1.0.1 #

  • Support package:build_runner v1.0.0.

1.0.0 #

  • Initial version, created by Stagehand

Use this package as a library

1. Depend on it

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

  build_version: ^2.0.1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:

import 'package:build_version/builder.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Sep 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.0
  • pana: 0.12.21


Detected platforms: Flutter, other

Platform components identified in package: build, io.

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and build_version.dart. Packages with multiple examples should provide example/

For more information see the pub package layout conventions.

The package description is too short. (-7 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
build >=0.12.1 <2.0.0 1.2.0
build_config >=0.3.0 <0.5.0 0.4.1+1
pubspec_parse ^0.1.2+2 0.1.5
Transitive dependencies
analyzer 0.38.3
args 1.5.2
async 2.3.0
charcode 1.1.2
checked_yaml 1.0.2
collection 1.14.12
convert 2.1.1
crypto 2.1.3
csslib 0.16.1
front_end 0.1.25
glob 1.1.7
html 0.14.0+2
json_annotation 3.0.0
kernel 0.3.25
logging 0.11.3+2
meta 1.1.7
package_config 1.1.0
path 1.6.4
pub_semver 1.4.2
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
watcher 0.9.7+12
yaml 2.2.0
Dev dependencies
build_runner ^1.0.0
build_test ^0.10.3+1
build_verify ^1.0.0
pedantic ^1.4.0 1.8.0+1
test ^1.2.0