fluffychat/lib/pangea/utils/platform_name.dart
2023-12-04 03:13:10 +01:00

41 lines
762 B
Dart

import 'dart:io' show Platform;
import 'package:flutter/foundation.dart' show kIsWeb, kDebugMode;
class MyPlatformName {
static String get platformName {
if (kIsWeb) {
return 'web';
}
if (Platform.isAndroid) {
return 'android';
}
if (Platform.isIOS) {
return 'ios';
}
if (Platform.isFuchsia) {
return 'fuchsia';
}
if (Platform.isLinux) {
return 'linux';
}
if (Platform.isMacOS) {
return 'macos';
}
if (Platform.isWindows) {
return 'windows';
}
return 'unknownplatform';
}
static String get getPlatformWithModeName {
String mode = 'Release';
if (kDebugMode) {
mode = 'Debug';
}
return MyPlatformName.platformName + mode;
}
}