mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-10 10:06:51 +00:00
Allow flipping sort order in mobile app's file transfer (#13273)
* Allow flipping sort order in mobile app's file transfer Signed-off-by: Nguyen Quy Hy <nguyenquyhy@live.com.sg> * Change ascending to be non-nullable Signed-off-by: Nguyen Quy Hy <nguyenquyhy@live.com.sg> * Revert file_model change Signed-off-by: Nguyen Quy Hy <nguyenquyhy@live.com.sg> --------- Signed-off-by: Nguyen Quy Hy <nguyenquyhy@live.com.sg>
This commit is contained in:
@@ -424,6 +424,7 @@ class FileManagerView extends StatefulWidget {
|
||||
class _FileManagerViewState extends State<FileManagerView> {
|
||||
final _listScrollController = ScrollController();
|
||||
final _breadCrumbScroller = ScrollController();
|
||||
late final ascending = Rx<bool>(controller.sortAscending);
|
||||
|
||||
bool get isLocal => widget.controller.isLocal;
|
||||
FileController get controller => widget.controller;
|
||||
@@ -635,7 +636,17 @@ class _FileManagerViewState extends State<FileManagerView> {
|
||||
))
|
||||
.toList();
|
||||
},
|
||||
onSelected: controller.changeSortStyle),
|
||||
onSelected: (sortBy) {
|
||||
// If selecting the same sort option, flip the order
|
||||
// If selecting a different sort option, use ascending order
|
||||
if (controller.sortBy.value == sortBy) {
|
||||
ascending.value = !controller.sortAscending;
|
||||
} else {
|
||||
ascending.value = true;
|
||||
}
|
||||
controller.changeSortStyle(sortBy, ascending: ascending.value);
|
||||
}
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user