21 lines
441 B
Dart
21 lines
441 B
Dart
|
import 'dart:io';
|
||
|
|
||
|
class PlatformUtils{
|
||
|
static String getOSName(){
|
||
|
if(Platform.isAndroid){
|
||
|
return 'android';
|
||
|
}else if(Platform.isFuchsia){
|
||
|
return 'fuchsia';
|
||
|
}else if(Platform.isIOS){
|
||
|
return 'ios';
|
||
|
}else if(Platform.isLinux){
|
||
|
return 'linux';
|
||
|
}else if(Platform.isMacOS){
|
||
|
return 'macos';
|
||
|
}else if(Platform.isWindows){
|
||
|
return 'windows';
|
||
|
}else{
|
||
|
return 'unknown';
|
||
|
}
|
||
|
}
|
||
|
}
|