#22 Add switch for run in bg

This commit is contained in:
lollipopkit
2023-03-28 17:35:49 +08:00
parent abee470afc
commit 30dddf462e
12 changed files with 71 additions and 23 deletions

View File

@@ -9,6 +9,7 @@ enum PlatformType {
macos,
windows,
web,
unknown,
}
final _p = () {
@@ -30,7 +31,7 @@ final _p = () {
if (Platform.isWindows) {
return PlatformType.windows;
}
return PlatformType.web;
return PlatformType.unknown;
}();
PlatformType get platform => _p;
@@ -41,3 +42,8 @@ bool get isLinux => _p == PlatformType.linux;
bool get isMacOS => _p == PlatformType.macos;
bool get isWindows => _p == PlatformType.windows;
bool get isWeb => _p == PlatformType.web;
bool get isMobile => _p == PlatformType.ios || _p == PlatformType.android;
bool get isDesktop =>
_p == PlatformType.linux ||
_p == PlatformType.macos ||
_p == PlatformType.windows;