getPlatformName method
Implementation
String getPlatformName() {
/// kIsWeb:true環境の場合、Platformを使うと処理が止まる
if (kIsWeb) {
return 'web';
} else {
if (Platform.isAndroid) {
return 'android';
} else if (Platform.isIOS) {
return 'ios';
} else if (Platform.isWindows) {
return 'windows';
} else if (Platform.isMacOS) {
return 'macos';
} else if (Platform.isLinux) {
return 'linux';
} else {
return Platform.operatingSystem.toLowerCase();
}
}
}