I have been trying to get the Android device version (For example 11, 12). I have been trying to get only the number
This is what I have done till now
void checkVersion(){
print(Platform.operatingSystemVersion); // it prints "sdk_gphone64_arm64-userdebug 12 S2B2.211203.006 8015633 dev-keys"
// I'm able to fetch the version number by splitting the string
// but the problem is that format of above string will vary by
// operating system, so not suitable for parsing
int platformVersion = int.parse(Platform.operatingSystemVersion.split(' ')[1]); it prints '12'
}