Version constructor Null safety

Version(
  1. int major,
  2. int minor,
  3. int patch,
  4. {String? pre,
  5. String? build}
)

Creates a new Version object.

Implementation

factory Version(int major, int minor, int patch,
    {String? pre, String? build}) {
  var text = '$major.$minor.$patch';
  if (pre != null) text += '-$pre';
  if (build != null) text += '+$build';

  return Version._(major, minor, patch, pre, build, text);
}