Merge pull request #4283 from fufesou/fix/disable_desktop_drop
disable desktop_drop for now
This commit is contained in:
commit
1753bd9dce
@ -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,7 +62,8 @@ class _FileManagerPageState extends State<FileManagerPage>
|
|||||||
with AutomaticKeepAliveClientMixin {
|
with AutomaticKeepAliveClientMixin {
|
||||||
final _mouseFocusScope = Rx<MouseFocusScope>(MouseFocusScope.none);
|
final _mouseFocusScope = Rx<MouseFocusScope>(MouseFocusScope.none);
|
||||||
|
|
||||||
final _dropMaskVisible = false.obs; // TODO impl drop mask
|
// Disable desktop_drop for now
|
||||||
|
// final _dropMaskVisible = false.obs; // TODO impl drop mask
|
||||||
final _overlayKeyState = OverlayKeyState();
|
final _overlayKeyState = OverlayKeyState();
|
||||||
|
|
||||||
late FFI _ffi;
|
late FFI _ffi;
|
||||||
@ -129,16 +130,21 @@ class _FileManagerPageState extends State<FileManagerPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget dropArea(FileManagerView fileView) {
|
Widget dropArea(FileManagerView fileView) {
|
||||||
return DropTarget(
|
return Container(
|
||||||
onDragDone: (detail) =>
|
child: fileView,
|
||||||
handleDragDone(detail, fileView.controller.isLocal),
|
);
|
||||||
onDragEntered: (enter) {
|
// Disable desktop_drop for now
|
||||||
_dropMaskVisible.value = true;
|
//
|
||||||
},
|
// return DropTarget(
|
||||||
onDragExited: (exit) {
|
// onDragDone: (detail) =>
|
||||||
_dropMaskVisible.value = false;
|
// handleDragDone(detail, fileView.controller.isLocal),
|
||||||
},
|
// onDragEntered: (enter) {
|
||||||
child: fileView);
|
// _dropMaskVisible.value = true;
|
||||||
|
// },
|
||||||
|
// onDragExited: (exit) {
|
||||||
|
// _dropMaskVisible.value = false;
|
||||||
|
// },
|
||||||
|
// child: fileView);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget generateCard(Widget child) {
|
Widget generateCard(Widget child) {
|
||||||
@ -316,22 +322,24 @@ class _FileManagerPageState extends State<FileManagerPage>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleDragDone(DropDoneDetails details, bool isLocal) {
|
// Disable desktop_drop for now
|
||||||
if (isLocal) {
|
//
|
||||||
// ignore local
|
// void handleDragDone(DropDoneDetails details, bool isLocal) {
|
||||||
return;
|
// if (isLocal) {
|
||||||
}
|
// // ignore local
|
||||||
final items = SelectedItems(isLocal: false);
|
// return;
|
||||||
for (var file in details.files) {
|
// }
|
||||||
final f = File(file.path);
|
// final items = SelectedItems(isLocal: false);
|
||||||
items.add(Entry()
|
// for (var file in details.files) {
|
||||||
..path = file.path
|
// final f = File(file.path);
|
||||||
..name = file.name
|
// items.add(Entry()
|
||||||
..size = FileSystemEntity.isDirectorySync(f.path) ? 0 : f.lengthSync());
|
// ..path = file.path
|
||||||
}
|
// ..name = file.name
|
||||||
final otherSideData = model.localController.directoryData();
|
// ..size = FileSystemEntity.isDirectorySync(f.path) ? 0 : f.lengthSync());
|
||||||
model.remoteController.sendFiles(items, otherSideData);
|
// }
|
||||||
}
|
// final otherSideData = model.localController.directoryData();
|
||||||
|
// model.remoteController.sendFiles(items, otherSideData);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
class FileManagerView extends StatefulWidget {
|
class FileManagerView extends StatefulWidget {
|
||||||
|
@ -70,7 +70,8 @@ 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
|
# Disable desktop_drop for now, because it may cause crash on Win11 when destructing.
|
||||||
|
# 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