Include the version of your package in our source code.
-
Add
build_version
topubspec.yaml
. Also make sure there is aversion
field.name: my_pkg version: 1.2.3 dev_dependencies: build_runner: ^1.0.0 build_version: ^2.0.0
-
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';