getRuntimePlatformInfo function
Returns platform info using dart:io Platform for native targets.
Implementation
String getRuntimePlatformInfo() {
final targetPlatform = switch (defaultTargetPlatform) {
TargetPlatform.android => 'Flutter Android',
TargetPlatform.iOS => 'Flutter iOS',
TargetPlatform.macOS => 'Flutter macOS',
TargetPlatform.windows => 'Flutter Windows',
TargetPlatform.linux => 'Flutter Linux',
TargetPlatform.fuchsia => 'Flutter Fuchsia',
};
final operatingSystemVersion = _normalizeWhitespace(
Platform.operatingSystemVersion,
);
final dartVersion = _extractDartVersion(Platform.version);
return '$targetPlatform; OS $operatingSystemVersion; Dart/$dartVersion';
}