kBuildNumber top-level constant

int const kBuildNumber

Holds the build number of the application. The value is read from the compile-time variable BUILD_NUMBER.

In BuildChannel.dev or BuildChannel.beta, the version usually stays the same until a stable release. The build number helps us and the users differentiate between different builds of the same version.

The value is read from the compile-time variable BUILD_NUMBER.

Defaults to 0 if the compile-time variable is not set.

In order to set the variable use --dart-define when building the app:

flutter build [os] --dart-define=BUILD_NUMBER=`VALUE`

Implementation

const kBuildNumber = int.fromEnvironment("BUILD_NUMBER", defaultValue: 0);