mirror of
https://github.com/lifegpc/eh_downloader_flutter.git
synced 2026-07-08 01:30:28 +08:00
Add Linux support
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user