getVersion static method

dynamic getVersion(
  1. dynamic version
)

Implementation

static getVersion(version){
  RegExp regExp = RegExp(r'v\d+\.\d+\.\d+');
  Iterable<Match> matches = regExp.allMatches(version ?? '');
  if (matches.isNotEmpty) {
  Match match = matches.first;
  print(match);
  version = match.group(0);
  }
  return version;
}