Version constructor

Version({
  1. required String version,
})

The version is passed as string in the format Major.Minor.Micro (Eg. 1.0.0)

Implementation

Version({required this.version}) {
  RegExp versionRegExp = new RegExp(r"[0-9]+(\\.[0-9]+)*");

  if (!versionRegExp.hasMatch(version)) {
    throw FormatException();
  }
}