appBuildName top-level constant

String? const appBuildName

The build name this application was built with.

This is the part of the version field in the app's pubspec.yaml before the + separator (for example 1.2.3 for version: 1.2.3+45), or the value of the --build-name option if it was provided at build time.

Unlike runtime lookups (such as reading version.json over the network on the web), this constant is embedded in the compiled application itself, so it always describes the code that is actually running.

This will be null if the pubspec has no version field and no --build-name option was provided.

Implementation

const String? appBuildName = bool.hasEnvironment('FLUTTER_BUILD_NAME')
    ? String.fromEnvironment('FLUTTER_BUILD_NAME')
    : null;