mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-19 06:43: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 {
|
||||
|
||||
Reference in new issue
Block a user