DragAndDropLists class

Inheritance

Constructors

DragAndDropLists({required List<DragAndDropListInterface> children, required OnItemReorder onItemReorder, required OnListReorder onListReorder, OnItemAdd? onItemAdd, OnListAdd? onListAdd, OnListDraggingChanged? onListDraggingChanged, ListOnWillAccept? listOnWillAccept, ListOnAccept? listOnAccept, ListTargetOnWillAccept? listTargetOnWillAccept, ListTargetOnAccept? listTargetOnAccept, OnItemDraggingChanged? onItemDraggingChanged, ItemOnWillAccept? itemOnWillAccept, ItemOnAccept? itemOnAccept, ItemTargetOnWillAccept? itemTargetOnWillAccept, ItemTargetOnAccept? itemTargetOnAccept, double? itemDraggingWidth, Widget? itemGhost, double itemGhostOpacity = 0.3, int itemSizeAnimationDurationMilliseconds = 150, bool itemDragOnLongPress = true, Decoration? itemDecorationWhileDragging, Widget? itemDivider, double? listDraggingWidth, Widget? listTarget, Widget? listGhost, double listGhostOpacity = 0.3, int listSizeAnimationDurationMilliseconds = 150, bool listDragOnLongPress = true, Decoration? listDecoration, Decoration? listDecorationWhileDragging, Decoration? listInnerDecoration, Widget? listDivider, bool listDividerOnLastChild = true, EdgeInsets? listPadding, Widget? contentsWhenEmpty, double listWidth = double.infinity, double lastItemTargetHeight = 20, bool addLastItemTargetHeightToTop = false, double lastListTargetSize = 110, CrossAxisAlignment verticalAlignment = CrossAxisAlignment.start, MainAxisAlignment horizontalAlignment = MainAxisAlignment.start, Axis axis = Axis.vertical, bool sliverList = false, ScrollController? scrollController, bool disableScrolling = false, DragHandle? listDragHandle, DragHandle? itemDragHandle, bool constrainDraggingAxis = true, bool removeTopPadding = false, Key? key})

Properties

addLastItemTargetHeightToTop bool
Add the same height as the lastItemTargetHeight to the top of the list. This is useful when setting the listInnerDecoration to maintain visual continuity between the top and the bottom
final
axis Axis
Determines whether the DragAndDropLists are displayed in a horizontal or vertical manner. Set axis to Axis.vertical for vertical arrangement of the lists. Set axis to Axis.horizontal for horizontal arrangement of the lists. If axis is set to Axis.horizontal, listWidth must be set to some finite number.
final
children List<DragAndDropListInterface>
The child lists to be displayed. If any of these children are DragAndDropListExpansion or inherit from DragAndDropListExpansionInterface, listGhost must not be null.
final
constrainDraggingAxis bool
Constrain the dragging axis in a vertical list to only allow dragging on the vertical axis. By default this is set to true. This may be useful to disable when setting customDragTargets
final
contentsWhenEmpty Widget?
A widget that will be displayed whenever a list contains no items.
final
disableScrolling bool
Set to true in order to disable all scrolling of the lists. Note: to disable scrolling for sliver lists, it is also necessary in your parent CustomScrollView to set physics to NeverScrollableScrollPhysics()
final
hashCode int
The hash code for this object.
no setterinherited
horizontalAlignment MainAxisAlignment
The default horizontal alignment of list contents.
final
itemDecorationWhileDragging Decoration?
The decoration surrounding an item while it is in the process of being dragged.
final
itemDivider Widget?
A widget that will be displayed between each individual item.
final
itemDraggingWidth double?
Width of a list item when it is being dragged.
final
itemDragHandle DragHandle?
Set a custom drag handle to use iOS-like handles to drag rather than long or short presses
final
itemDragOnLongPress bool
If true, drag an item after doing a long press. If false, drag immediately.
final
itemGhost Widget?
The widget that will be displayed at a potential drop position in a list when an item is being dragged.
final
itemGhostOpacity double
The opacity of the itemGhost. This must be between 0 and 1.
final
itemOnAccept ItemOnAccept?
Set in order to get the items involved in a drag and drop operation after an item has been accepted. For general use cases where only reordering is necessary, only onItemReorder or onItemAdd is needed, and this should be left null. onItemReorder or onItemAdd will be called after this.
final
itemOnWillAccept ItemOnWillAccept?
Set in order to provide custom acceptance criteria for when a item can be dropped onto a specific other item
final
itemSizeAnimationDurationMilliseconds int
Length of animation for the change in an item size when displaying the itemGhost.
final
itemTargetOnAccept ItemTargetOnAccept?
Set in order to get the item and target involved in a drag and drop operation after a item has been accepted. For general use cases where only reordering is necessary, only onItemReorder or onItemAdd is needed, and this should be left null. onItemReorder or onItemAdd will be called after this.
final
itemTargetOnWillAccept ItemTargetOnWillAccept?
Set in order to provide custom acceptance criteria for when a item can be dropped onto a specific target. This target always exists as the last target for list of items, and also can be used independently.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
lastItemTargetHeight double
The height of the target for the last item in a list. This should be large enough to easily drag an item into the last position of a list.
final
lastListTargetSize double
The height of the target for the last list. This should be large enough to easily drag a list to the last position in the DragAndDropLists.
final
listDecoration Decoration?
The decoration surrounding a list.
final
listDecorationWhileDragging Decoration?
The decoration surrounding a list while it is in the process of being dragged.
final
listDivider Widget?
A widget that will be displayed between each individual list.
final
listDividerOnLastChild bool
Whether it should put a divider on the last list or not.
final
listDraggingWidth double?
The width of a list when dragging.
final
listDragHandle DragHandle?
Set a custom drag handle to use iOS-like handles to drag rather than long or short presses
final
listDragOnLongPress bool
Whether a list should be dragged on a long or short press. When true, the list will be dragged after a long press. When false, it will be dragged immediately.
final
listGhost Widget?
The widget to be displayed at a potential list position while a list is being dragged. This must not be null when children includes one or more DragAndDropListExpansion or other class that inherit from DragAndDropListExpansionInterface.
final
listGhostOpacity double
The opacity of listGhost. It must be between 0 and 1.
final
listInnerDecoration Decoration?
The decoration surrounding the inner list of items.
final
listOnAccept ListOnAccept?
Set in order to get the lists involved in a drag and drop operation after a list has been accepted. For general use cases where only reordering is necessary, only onListReorder or onListAdd is needed, and this should be left null. onListReorder or onListAdd will be called after this.
final
listOnWillAccept ListOnWillAccept?
Set in order to provide custom acceptance criteria for when a list can be dropped onto a specific other list
final
listPadding EdgeInsets?
The padding between each individual list.
final
listSizeAnimationDurationMilliseconds int
The duration of the animation for the change in size when a listGhost is displayed at list position.
final
listTarget Widget?
The widget to be displayed as the last element in the DragAndDropLists, where a list will be accepted as the last list.
final
listTargetOnAccept ListTargetOnAccept?
Set in order to get the list and target involved in a drag and drop operation after a list has been accepted. For general use cases where only reordering is necessary, only onListReorder or onListAdd is needed, and this should be left null. onListReorder or onListAdd will be called after this.
final
listTargetOnWillAccept ListTargetOnWillAccept?
Set in order to provide custom acceptance criteria for when a list can be dropped onto a specific target. This target always exists as the last target the DragAndDropLists, and also can be used independently.
final
listWidth double
The width of each individual list. This must be set to a finite value when axis is set to Axis.horizontal.
final
onItemAdd OnItemAdd?
Calls this function when a new item has been added.
final
onItemDraggingChanged OnItemDraggingChanged?
Called when an item dragging is starting or ending
final
onItemReorder OnItemReorder
Calls this function when a list element is reordered. Takes into account the index change when removing an item, so the newItemIndex can be used directly when inserting.
final
onListAdd OnListAdd?
Calls this function when a new list has been added.
final
onListDraggingChanged OnListDraggingChanged?
Called when a list dragging is starting or ending
final
onListReorder OnListReorder
Calls this function when a list is reordered. Takes into account the index change when removing a list, so the newListIndex can be used directly when inserting.
final
removeTopPadding bool
If you put a widget before DragAndDropLists there's an unexpected padding before the list renders. This is the default behaviour for ListView which is used internally. To remove the padding, set this field to true https://github.com/flutter/flutter/issues/14842#issuecomment-371344881
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollController ScrollController?
A scroll controller that can be used for the scrolling of the first level lists. This must be set if sliverList is set to true.
final
sliverList bool
Whether or not to return a widget or a sliver-compatible list. Set to true if using as a sliver. If true, a scrollController must be provided. Set to false if using in a widget only.
final
verticalAlignment CrossAxisAlignment
The default vertical alignment of list contents.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<StatefulWidget>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited