We use the harmony_os_version
plugin to get harmony os version.
To use this plugin, add harmony_os_version
as a dependency in your pubspec.yaml file. For example:
dependencies:
harmony_os_version: ^1.0.0
_xxx() async {
String? osVersion = HarmonyOsVersion().osVersion();
print(osVersion);
}