the dart code generator for your package versions.
there is no way to get the package version from the code in the dart ecosystem.
installation
- add build_runner and versiongen to your package’s pubspec.yaml file:
dev_dependencies:
build_runner:
version_gen:
- install versiongen
$ flutter pub get
- use versiongen
$ flutter packages pub run build_runner build
configuration file
versiongen generates dart files based on the key versiongen
of pubspec.yaml
.
default configuration can be found here.
# pubspec.yaml
# ...
dev_dependencies:
build_runner:
version_gen:
# optional (default: lib/gen/)
version_gen:
path: lib/gen/
output file
/// do not modify by hand, generated by version_gen
string packageversion = '1.0.0+1';
issues
please file [fluttergen] specific issues, bugs, or feature requests in our issue tracker.
plugin issues that are not specific to [fluttergen] can be filed in the flutter issue tracker.
Comments are closed.