Merge pull request #4339 from rustdesk/revert-4283-fix/disable_desktop_drop
Revert "disable desktop_drop for now"
This commit is contained in:
commit
918b297649
@ -4,7 +4,7 @@ import 'dart:math';
|
|||||||
|
|
||||||
import 'package:flutter_hbb/desktop/widgets/dragable_divider.dart';
|
import 'package:flutter_hbb/desktop/widgets/dragable_divider.dart';
|
||||||
import 'package:percent_indicator/percent_indicator.dart';
|
import 'package:percent_indicator/percent_indicator.dart';
|
||||||
// import 'package:desktop_drop/desktop_drop.dart';
|
import 'package:desktop_drop/desktop_drop.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
@ -62,8 +62,7 @@ class _FileManagerPageState extends State<FileManagerPage>
|
|||||||
with AutomaticKeepAliveClientMixin {
|
with AutomaticKeepAliveClientMixin {
|
||||||
final _mouseFocusScope = Rx<MouseFocusScope>(MouseFocusScope.none);
|
final _mouseFocusScope = Rx<MouseFocusScope>(MouseFocusScope.none);
|
||||||
|
|
||||||
// Disable desktop_drop for now
|
final _dropMaskVisible = false.obs; // TODO impl drop mask
|
||||||
// final _dropMaskVisible = false.obs; // TODO impl drop mask
|
|
||||||
final _overlayKeyState = OverlayKeyState();
|
final _overlayKeyState = OverlayKeyState();
|
||||||
|
|
||||||
late FFI _ffi;
|
late FFI _ffi;
|
||||||
@ -130,21 +129,16 @@ class _FileManagerPageState extends State<FileManagerPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget dropArea(FileManagerView fileView) {
|
Widget dropArea(FileManagerView fileView) {
|
||||||
return Container(
|
return DropTarget(
|
||||||
child: fileView,
|
onDragDone: (detail) =>
|
||||||
);
|
handleDragDone(detail, fileView.controller.isLocal),
|
||||||
// Disable desktop_drop for now
|
onDragEntered: (enter) {
|
||||||
//
|
_dropMaskVisible.value = true;
|
||||||
// return DropTarget(
|
},
|
||||||
// onDragDone: (detail) =>
|
onDragExited: (exit) {
|
||||||
// handleDragDone(detail, fileView.controller.isLocal),
|
_dropMaskVisible.value = false;
|
||||||
// onDragEntered: (enter) {
|
},
|
||||||
// _dropMaskVisible.value = true;
|
child: fileView);
|
||||||
// },
|
|
||||||
// onDragExited: (exit) {
|
|
||||||
// _dropMaskVisible.value = false;
|
|
||||||
// },
|
|
||||||
// child: fileView);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget generateCard(Widget child) {
|
Widget generateCard(Widget child) {
|
||||||
@ -322,24 +316,22 @@ class _FileManagerPageState extends State<FileManagerPage>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disable desktop_drop for now
|
void handleDragDone(DropDoneDetails details, bool isLocal) {
|
||||||
//
|
if (isLocal) {
|
||||||
// void handleDragDone(DropDoneDetails details, bool isLocal) {
|
// ignore local
|
||||||
// if (isLocal) {
|
return;
|
||||||
// // ignore local
|
}
|
||||||
// return;
|
final items = SelectedItems(isLocal: false);
|
||||||
// }
|
for (var file in details.files) {
|
||||||
// final items = SelectedItems(isLocal: false);
|
final f = File(file.path);
|
||||||
// for (var file in details.files) {
|
items.add(Entry()
|
||||||
// final f = File(file.path);
|
..path = file.path
|
||||||
// items.add(Entry()
|
..name = file.name
|
||||||
// ..path = file.path
|
..size = FileSystemEntity.isDirectorySync(f.path) ? 0 : f.lengthSync());
|
||||||
// ..name = file.name
|
}
|
||||||
// ..size = FileSystemEntity.isDirectorySync(f.path) ? 0 : f.lengthSync());
|
final otherSideData = model.localController.directoryData();
|
||||||
// }
|
model.remoteController.sendFiles(items, otherSideData);
|
||||||
// final otherSideData = model.localController.directoryData();
|
}
|
||||||
// model.remoteController.sendFiles(items, otherSideData);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class FileManagerView extends StatefulWidget {
|
class FileManagerView extends StatefulWidget {
|
||||||
|
@ -70,8 +70,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
|
||||||
# Disable desktop_drop for now, because it may cause crash on Win11 when destructing.
|
desktop_drop: ^0.3.3
|
||||||
# desktop_drop: ^0.4.1
|
|
||||||
scroll_pos: ^0.3.0
|
scroll_pos: ^0.3.0
|
||||||
debounce_throttle: ^2.0.0
|
debounce_throttle: ^2.0.0
|
||||||
file_picker: ^5.1.0
|
file_picker: ^5.1.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user