mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: ignore dragtarget event when performing insert animation
This commit is contained in:
parent
fcb144e514
commit
e42bfe0b1e
@ -82,6 +82,8 @@ class ReorderFlex extends StatefulWidget {
|
|||||||
|
|
||||||
final ReorderDragTargetIndexKeyStorage? dragTargetIndexKeyStorage;
|
final ReorderDragTargetIndexKeyStorage? dragTargetIndexKeyStorage;
|
||||||
|
|
||||||
|
final bool reorderable;
|
||||||
|
|
||||||
ReorderFlex({
|
ReorderFlex({
|
||||||
Key? key,
|
Key? key,
|
||||||
this.scrollController,
|
this.scrollController,
|
||||||
@ -89,6 +91,7 @@ class ReorderFlex extends StatefulWidget {
|
|||||||
required this.children,
|
required this.children,
|
||||||
required this.config,
|
required this.config,
|
||||||
required this.onReorder,
|
required this.onReorder,
|
||||||
|
this.reorderable = true,
|
||||||
this.dragStateStorage,
|
this.dragStateStorage,
|
||||||
this.dragTargetIndexKeyStorage,
|
this.dragTargetIndexKeyStorage,
|
||||||
this.onDragStarted,
|
this.onDragStarted,
|
||||||
@ -385,7 +388,7 @@ class ReorderFlexState extends State<ReorderFlex>
|
|||||||
},
|
},
|
||||||
onWillAccept: (FlexDragTargetData dragTargetData) {
|
onWillAccept: (FlexDragTargetData dragTargetData) {
|
||||||
// Do not receive any events if the Insert item is animating.
|
// Do not receive any events if the Insert item is animating.
|
||||||
if (_animation.deleteController.isAnimating) {
|
if (_animation.insertController.isAnimating) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -421,6 +424,7 @@ class ReorderFlexState extends State<ReorderFlex>
|
|||||||
deleteAnimationController: _animation.deleteController,
|
deleteAnimationController: _animation.deleteController,
|
||||||
draggableTargetBuilder: widget.interceptor?.draggableTargetBuilder,
|
draggableTargetBuilder: widget.interceptor?.draggableTargetBuilder,
|
||||||
useMoveAnimation: widget.config.useMoveAnimation,
|
useMoveAnimation: widget.config.useMoveAnimation,
|
||||||
|
draggable: widget.reorderable,
|
||||||
child: child,
|
child: child,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user