Add Linux support

This commit is contained in:
2023-11-26 15:12:51 +08:00
parent 3dada54d8c
commit 9810214903
5 changed files with 29 additions and 4 deletions

View File

@@ -39,7 +39,7 @@ Config? _prefs;
EHApi? _api;
Future<String> _getJarPath() async {
if (isWindows) {
if (isWindows || isLinux) {
try {
final p = await platformPath.getCurrentExe();
if (p != null) {
@@ -60,7 +60,7 @@ Future<void> prepareJar() async {
}
Future<void> preparePrefs() async {
if (isWindows) {
if (isWindows || isLinux) {
try {
var tmp = WindowsConfig();
tmp.reload();

View File

@@ -17,7 +17,7 @@ class LogsFile {
IOSink? _cached;
Future<void> init() async {
if (_cachedLogDirectory != null) return;
if (isWindows) {
if (isWindows || isLinux) {
try {
final p = await platformPath.getCurrentExe();
if (p != null) {

View File

@@ -4,6 +4,7 @@ import 'package:flutter/foundation.dart';
bool get isDesktop =>
!kIsWeb && (Platform.isWindows || Platform.isLinux || Platform.isMacOS);
bool get isWindows => !kIsWeb && Platform.isWindows;
bool get isLinux => !kIsWeb && Platform.isLinux;
bool get isAndroid => !kIsWeb && Platform.isAndroid;
bool get isIOS => !kIsWeb && Platform.isIOS;