parseVersion function
Parse a dotted version into a list of ints, or [] when empty/invalid. Never throws.
Implementation
List<int> parseVersion(String? raw) {
if (raw == null) return const [];
final s = raw.trim();
if (!_versionRe.hasMatch(s)) return const [];
final parts = <int>[];
for (final component in s.split('.')) {
final n = int.tryParse(component);
if (n == null) return const [];
parts.add(n);
}
return parts;
}