A builder for extracting a package version into code.
Include the version of your package in our source code.
pubspec.yaml. Also make sure there is a
name: my_pkg version: 1.2.3 dev_dependencies: build_runner: build_version: ^1.0.0
targets: $default: builders: build_version: enabled: true
Run a build.
> pub run build_runner build
lib/src/version.dartwill be generated with content:
// Generated code. Do not modify. const packageVersion = '1.2.3';