diff --git a/flutter/lib/desktop/pages/file_manager_page.dart b/flutter/lib/desktop/pages/file_manager_page.dart index 0deb6741d..e9e69556c 100644 --- a/flutter/lib/desktop/pages/file_manager_page.dart +++ b/flutter/lib/desktop/pages/file_manager_page.dart @@ -8,7 +8,6 @@ import 'package:flutter_hbb/models/file_model.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:get/get.dart'; import 'package:provider/provider.dart'; -import 'package:toggle_switch/toggle_switch.dart'; import 'package:wakelock/wakelock.dart'; import '../../common.dart'; @@ -79,24 +78,24 @@ class _FileManagerPageState extends State IconButton(icon: Icon(Icons.close), onPressed: clientClose), ]), centerTitle: true, - title: ToggleSwitch( - initialLabelIndex: model.isLocal ? 0 : 1, - activeBgColor: [MyTheme.idColor], - inactiveBgColor: MyTheme.grayBg, - inactiveFgColor: Colors.black54, - totalSwitches: 2, - minWidth: 100, - fontSize: 15, - iconSize: 18, - labels: [translate("Local"), translate("Remote")], - icons: [Icons.phone_android_sharp, Icons.screen_share], - onToggle: (index) { - final current = model.isLocal ? 0 : 1; - if (index != current) { - model.togglePage(); - } - }, - ), + // title: ToggleSwitch( + // initialLabelIndex: model.isLocal ? 0 : 1, + // activeBgColor: [MyTheme.idColor], + // inactiveBgColor: MyTheme.grayBg, + // inactiveFgColor: Colors.black54, + // totalSwitches: 2, + // minWidth: 100, + // fontSize: 15, + // iconSize: 18, + // labels: [translate("Local"), translate("Remote")], + // icons: [Icons.phone_android_sharp, Icons.screen_share], + // onToggle: (index) { + // final current = model.isLocal ? 0 : 1; + // if (index != current) { + // model.togglePage(); + // } + // }, + // ), actions: [ PopupMenuButton( icon: Icon(Icons.more_vert), @@ -196,7 +195,12 @@ class _FileManagerPageState extends State }), ], ), - body: body(), + body: Row( + children: [ + Flexible(flex: 1, child: body(isLocal: true)), + Flexible(flex: 1, child: body(isLocal: false)) + ], + ), bottomSheet: bottomSheet(), )); })); @@ -209,9 +213,8 @@ class _FileManagerPageState extends State return !_selectedItems.isOtherPage(model.isLocal); } - Widget body() { - final isLocal = model.isLocal; - final fd = model.currentDir; + Widget body({bool isLocal = false}) { + final fd = isLocal ? model.currentLocalDir : model.currentRemoteDir; final entries = fd.entries; return Column(children: [ headTools(), diff --git a/flutter/lib/models/file_model.dart b/flutter/lib/models/file_model.dart index aefdcf639..9ed8b54d7 100644 --- a/flutter/lib/models/file_model.dart +++ b/flutter/lib/models/file_model.dart @@ -233,7 +233,12 @@ class FileModel extends ChangeNotifier { } refresh() { - openDirectory(currentDir.path); + if (isDesktop) { + openDirectory(currentRemoteDir.path); + openDirectory(currentLocalDir.path); + } else { + openDirectory(currentDir.path); + } } openDirectory(String path, {bool? isLocal}) async {