getVersionArray method

List<String> getVersionArray(
  1. String versionString
)

Implementation

List<String> getVersionArray(String versionString) {
  RegExp versionRegex = RegExp(r'(?:Version )?(\d+(?:\.\d+){0,2})');
  Match? match = versionRegex.firstMatch(versionString);

  List<String> versionArray = [];

  if (match != null) {
    String versionNumber = match.group(1)!;
    versionArray = versionNumber.split('.').toList();
  }
  return versionArray;
}