Merge pull request #1286 from Kingtous/flutter_desktop

feat: file transfer selectable navigation tools & search bar
This commit is contained in:
RustDesk 2022-08-16 14:04:33 +08:00 committed by GitHub
commit f797125ae2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 604 additions and 384 deletions

File diff suppressed because it is too large Load Diff

View File

@ -68,6 +68,22 @@ class FileModel extends ChangeNotifier {
return isLocal ? currentLocalDir : currentRemoteDir; return isLocal ? currentLocalDir : currentRemoteDir;
} }
String getCurrentShortPath(bool isLocal) {
final currentDir = getCurrentDir(isLocal);
final currentHome = getCurrentHome(isLocal);
if (currentDir.path.startsWith(currentHome)) {
var path = currentDir.path.replaceFirst(currentHome, "");
if (path.length == 0) return "";
if (path[0] == "/" || path[0] == "\\") {
// remove more '/' or '\'
path = path.replaceFirst(path[0], "");
}
return path;
} else {
return currentDir.path.replaceFirst(currentHome, "");
}
}
String get currentHome => _isLocal ? _localOption.home : _remoteOption.home; String get currentHome => _isLocal ? _localOption.home : _remoteOption.home;
String getCurrentHome(bool isLocal) { String getCurrentHome(bool isLocal) {
@ -716,6 +732,7 @@ class FileModel extends ChangeNotifier {
job.totalSize = total_size.toInt(); job.totalSize = total_size.toInt();
} }
debugPrint("update folder files: ${info}"); debugPrint("update folder files: ${info}");
notifyListeners();
} }
bool get remoteSortAscending => _remoteSortAscending; bool get remoteSortAscending => _remoteSortAscending;

View File

@ -239,6 +239,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.0.12" version: "0.0.12"
desktop_drop:
dependency: "direct main"
description:
name: desktop_drop
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.3"
desktop_multi_window: desktop_multi_window:
dependency: "direct main" dependency: "direct main"
description: description:
@ -817,7 +824,7 @@ packages:
name: qr_code_scanner name: qr_code_scanner
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0" version: "1.0.1"
quiver: quiver:
dependency: transitive dependency: transitive
description: description:

View File

@ -69,6 +69,7 @@ dependencies:
get: ^4.6.5 get: ^4.6.5
visibility_detector: ^0.3.3 visibility_detector: ^0.3.3
contextmenu: ^3.0.0 contextmenu: ^3.0.0
desktop_drop: ^0.3.3
dev_dependencies: dev_dependencies:
flutter_launcher_icons: ^0.9.1 flutter_launcher_icons: ^0.9.1