nextMinor property Null safety

Version nextMinor

Gets the next minor version number that follows this one.

If this version is a pre-release of a minor version release (i.e. the patch version is zero), then it just strips the pre-release suffix. Otherwise, it increments the minor version and resets the patch.

Implementation

Version get nextMinor {
  if (isPreRelease && patch == 0) {
    return Version(major, minor, patch);
  }

  return _incrementMinor();
}