IsMajorMinor static method

bool IsMajorMinor(
  1. String versionPart
)

Implementation

static bool IsMajorMinor(String versionPart) {
  final RegExp numberRegExp = RegExp(r'\d');
  const String MajorMinorSeparator = '.';

  List<String> parts = versionPart.split(MajorMinorSeparator);
  if (parts.length != 2) {
    return false;
  }

  for (String s in parts) {
    if (!numberRegExp.hasMatch(s)) return false;
  }

  return true;
}