isVersionBelow static method

bool isVersionBelow(
  1. String installed,
  2. String minimum
)

Returns true when installed is strictly less than minimum.

Compares major, minor, and patch components numerically so "2.10.0" is correctly treated as greater than "2.9.0". Any non-numeric segment causes a FormatException which the catch block intercepts, returning false (fail-open: do not block the user on a malformed Remote Config value). Missing components beyond the supplied segments are treated as 0.

Static so it can be called outside the startup sequence — for example, by the app-resume version check in DriverLite.

Implementation

static bool isVersionBelow(String installed, String minimum) {
  try {
    final List<int> a = _parseVersion(installed);
    final List<int> b = _parseVersion(minimum);
    for (int i = 0; i < 3; i++) {
      if (a[i] != b[i]) return a[i] < b[i];
    }
    return false; // equal versions → not below
  } catch (_) {
    return false; // malformed version string — fail-open
  }
}