parse method
Implementation
ZegoMobileSystemVersion parse(String operatingSystemVersion) {
var systemVersion = ZegoMobileSystemVersion.empty();
if (Platform.isAndroid) {
final RegExp versionRegExp = RegExp(r'(\d+)\.(\d+)\.(\d+)');
final match = versionRegExp.firstMatch(operatingSystemVersion);
if (match != null) {
systemVersion.major = int.parse(match.group(1)!);
systemVersion.minor = int.parse(match.group(2)!);
}
} else if (Platform.isIOS) {
final RegExp versionRegExp = RegExp(r'(\d+)\.(\d+)(?:\.(\d+))?');
final match = versionRegExp.firstMatch(operatingSystemVersion);
if (match != null) {
systemVersion.major = int.parse(match.group(1)!);
systemVersion.minor = int.parse(match.group(2)!);
if (match.group(3) != null) {
systemVersion.patch = int.parse(match.group(3)!);
}
}
}
return systemVersion;
}