FLUTTER ECOSYSTEM

build_version

A builder for extracting a package version into code.

Latest version
2.1.3
30-day downloads
127K
Likes
32
Pub points
150

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Overview

build_version is a Flutter/Dart package that generates a Dart file containing the current version of a package during the build process. It extracts version information from pubspec.yaml and makes it available as a constant in the application code, enabling runtime access to version details without manual updates. This is particularly useful for debugging, logging, or displaying version numbers in the UI. The package integrates seamlessly with the build_runner and supports multiple platforms including Android, iOS, macOS, Windows, and Linux.

Use cases
  • Displaying app version in settings
  • Logging version info for debugging
  • Automating version injection into code
  • Tracking release versions in builds
  • Enabling version checks in app logic
Key features
  • Auto-generates version constants
  • Extracts version from pubspec.yaml
  • Supports multiple platforms
  • Integrates with build_runner
  • Minimal configuration required
Suitable for
  • Apps needing runtime version access
  • Teams wanting automated version management
  • Projects using build_runner workflows
  • Developers seeking minimal boilerplate
  • CI/CD pipelines requiring version metadata
Considerations
  • Requires build_runner to be set up
  • Version is static after build
  • Not suitable for dynamic version changes
  • May require rebuild on version update
  • Limited to version field in pubspec.yaml
Supported platformsAndroidiOSmacOSWindowsLinux

Install package

flutter pub add build_version

Categories

Dependencies

Dependency list 3 items

Source repository

Related projects