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: ^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';
build_versionis a dependency.
build.yamlchanges are no longer required.
Add this to your package's pubspec.yaml file:
dependencies: build_version: ^2.0.0
You can install packages from the command line:
$ pub get
$ flutter packages get
Alternatively, your editor might support
pub get or
flutter packages get.
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
|2.0.0||Sep 27, 2018|
|1.0.1||Sep 27, 2018|
|1.0.0||Sep 1, 2018|
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]
We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Detected platforms: Flutter, other
Platform components identified in package:
The description is too short. (-20 points)
Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.
Maintain an example. (-10 points)
Create a short demo in the
example/ directory to show how to use this package. Common file name patterns include:
example.dart or you could also use
|Dart SDK||>=2.0.0 <3.0.0|