toVersionNumber static method

int? toVersionNumber(
  1. String? version
)

Implementation

static int? toVersionNumber(String? version) {
  if (version == null) return null;
  try {
    version = version.replaceAll("+", "");
    List versionCells = version.split('.');
    versionCells = versionCells.map((i) => int.parse(i)).toList();
    return versionCells[0] * 100000 +
        versionCells[1] * 1000 +
        versionCells[2];
  } catch (e) {
    return null;
  }
}