mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-18 14:23:42 +00:00
feat: task detail view (#633)
This commit is contained in:
22 files changed
+280
-105
No files matched your search
@@ -1,5 +1,7 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
|
||||
class FileExplorer {
|
||||
static Future<void> openAndSelectFile(String filePath) async {
|
||||
if (await FileSystemEntity.isFile(filePath)) {
|
||||
@@ -10,17 +12,7 @@ class FileExplorer {
|
||||
}
|
||||
|
||||
static Future<void> _openDirectory(String directoryPath) async {
|
||||
if (Platform.isWindows) {
|
||||
Process.run('explorer.exe', [directoryPath]);
|
||||
} else if (Platform.isMacOS) {
|
||||
Process.run('open', [directoryPath]);
|
||||
} else if (Platform.isLinux) {
|
||||
if (await _isUbuntuOrDebian()) {
|
||||
Process.run('xdg-open', [directoryPath]);
|
||||
} else if (await _isCentOS()) {
|
||||
Process.run('nautilus', [directoryPath]);
|
||||
}
|
||||
}
|
||||
await launchUrlString("file://$directoryPath");
|
||||
}
|
||||
|
||||
static Future<void> _openFile(String filePath) async {
|
||||
|
||||
@@ -15,11 +15,15 @@ initLogger() {
|
||||
);
|
||||
}
|
||||
|
||||
String logsDir() {
|
||||
return path.join(Util.getStorageDir(), 'logs');
|
||||
}
|
||||
|
||||
_buildOutput() {
|
||||
// if is debug mode, don't log to file
|
||||
if (!kDebugMode && Util.isDesktop()) {
|
||||
final logDirPath = path.join(Util.getStorageDir(), 'logs');
|
||||
var logDir = Directory(logDirPath);
|
||||
final logDirPath = logsDir();
|
||||
var logDir = Directory(logsDir());
|
||||
if (!logDir.existsSync()) {
|
||||
logDir.createSync();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user