Version.parse constructor
Creates a new Version by parsing text
.
Implementation
factory Version.parse(String text) {
final match = COMPLETE_VERSION.firstMatch(text);
if (match == null) {
throw new FormatException('Could not parse "$text".');
}
try {
int major = int.parse(match[1]);
int minor = int.parse(match[2]);
int patch = int.parse(match[3]);
String preRelease = match[5];
String build = match[8];
return new Version._(major, minor, patch, preRelease, build, text);
} on FormatException {
throw new FormatException('Could not parse "$text".');
}
}