ProjectVersion class
Representation of a Flutter application version (e.g. 1.8.2+42).
Composes a Semantic Versioning name (versionName = 1.8.2) and
a build number (buildNumber = 42).
- Implemented types
Constructors
- ProjectVersion({required int major, required int minor, required int patch, String? preRelease, int? buildNumber})
-
const
- ProjectVersion.parse(String input)
-
Parses a Flutter version string like
1.8.2+42or1.8.2or2.0.0-rc.1+100.factory
Properties
- buildNumber → int?
-
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- major → int
-
final
- minor → int
-
final
- patch → int
-
final
- preRelease → String?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- versionName → String
-
Formatted version string without build number (e.g.
1.8.2or1.8.2-beta.1).no setter
Methods
-
bumpMajor(
{int? nextBuildNumber}) → ProjectVersion -
Returns a copy with incremented major version (
1.8.2+42->2.0.0+43). -
bumpMinor(
{int? nextBuildNumber}) → ProjectVersion -
Returns a copy with incremented minor version (
1.8.2+42->1.9.0+43). -
bumpPatch(
{int? nextBuildNumber}) → ProjectVersion -
Returns a copy with incremented patch version (
1.8.2+42->1.8.3+43). -
compareTo(
ProjectVersion other) → int -
Compares this object to another object.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
Full version string formatted for
pubspec.yaml(e.g.1.8.2+42).override -
withBuildNumber(
int newBuildNumber) → ProjectVersion - Returns a copy with a specific build number.
-
withVersionName(
String newVersionName, {int? newBuildNumber}) → ProjectVersion - Returns a copy with a new version name and optional build number.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override