LongPressDraggable,它是Draggable的子類,使用方式基本和Draggable 一致,它和Draggable區別就是LongPressDraggable的手勢識別須要長按纔會觸發。 可參考這篇文章: 《Flutter 基礎之 Draggable》git
Object —> Diagnosticable —> DiagnosticableTree —> Widget —> StatefulWidget —> Draggable —> LongPressDraggablegithub
LongPressDraggable({Key key,
@required Widget child,
@required Widget feedback,
T data,
Axis axis,
Widget childWhenDragging,
Offset feedbackOffset: Offset.zero,
DragAnchor dragAnchor: DragAnchor.child,
int maxSimultaneousDrags,
VoidCallback onDragStarted,
DraggableCanceledCallback onDraggableCanceled,
DragEndCallback onDragEnd,
VoidCallback onDragCompleted,
bool hapticFeedbackOnStart: true,
bool ignoringFeedbackSemantics: true })
複製代碼
能夠看出它和Draggable的構造函數參數基本一致,主要有如下區別:bash
能夠參考 《Flutter 基礎之 Draggable》函數
能夠參考 《Flutter 基礎之 Draggable》ui
xiaosongzeem |