mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-15 12:53:41 +00:00
feat: ios support (#194)
This commit is contained in:
46 files changed
+274
-54
No files matched your search
@@ -225,7 +225,7 @@ class AppController extends GetxController with WindowListener, TrayListener {
|
||||
return _defaultStartConfig!;
|
||||
}
|
||||
_defaultStartConfig = StartConfig();
|
||||
if (!Util.isUnix()) {
|
||||
if (!Util.supportUnixSocket()) {
|
||||
// not support unix socket, use tcp
|
||||
_defaultStartConfig!.network = "tcp";
|
||||
_defaultStartConfig!.address = "127.0.0.1:0";
|
||||
|
||||
@@ -342,13 +342,11 @@ class SettingView extends GetView<SettingController> {
|
||||
await debounceSave(needRestart: true);
|
||||
},
|
||||
items: [
|
||||
!Util.isMobile()
|
||||
? const DropdownMenuItem<String>(
|
||||
value: 'tcp',
|
||||
child: Text('TCP'),
|
||||
)
|
||||
: null,
|
||||
Util.isUnix()
|
||||
const DropdownMenuItem<String>(
|
||||
value: 'tcp',
|
||||
child: Text('TCP'),
|
||||
),
|
||||
Util.supportUnixSocket()
|
||||
? const DropdownMenuItem<String>(
|
||||
value: 'unix',
|
||||
child: Text('Unix'),
|
||||
|
||||
@@ -24,7 +24,7 @@ class _DirectorySelectorState extends State<DirectorySelector> {
|
||||
children: [
|
||||
Expanded(
|
||||
child: TextFormField(
|
||||
readOnly: Util.isWeb() ? false : true,
|
||||
readOnly: Util.isWeb() && !Util.isIOS() ? false : true,
|
||||
controller: widget.controller,
|
||||
decoration: widget.showLabel
|
||||
? InputDecoration(
|
||||
@@ -35,7 +35,7 @@ class _DirectorySelectorState extends State<DirectorySelector> {
|
||||
return v!.trim().isNotEmpty ? null : 'downloadDirValid'.tr;
|
||||
},
|
||||
)),
|
||||
Util.isDesktop() || Util.isAndroid()
|
||||
!Util.isWeb() && !Util.isIOS()
|
||||
? IconButton(
|
||||
icon: const Icon(Icons.folder_open),
|
||||
onPressed: () async {
|
||||
|
||||
@@ -53,15 +53,15 @@ class Util {
|
||||
return !kIsWeb && Platform.isMacOS;
|
||||
}
|
||||
|
||||
static isUnix() {
|
||||
static isWeb() {
|
||||
return kIsWeb;
|
||||
}
|
||||
|
||||
static supportUnixSocket() {
|
||||
if (kIsWeb) {
|
||||
return false;
|
||||
}
|
||||
return !Platform.isWindows;
|
||||
}
|
||||
|
||||
static isWeb() {
|
||||
return kIsWeb;
|
||||
return Platform.isLinux || Platform.isMacOS || Platform.isAndroid;
|
||||
}
|
||||
|
||||
static List<String> textToLines(String text) {
|
||||
|
||||
Reference in new issue
Block a user