MhItemsViewDragDropSettings<T> class

Provides settings to control the drag and Drop behavior of the MhItemsView

Constructors

MhItemsViewDragDropSettings({bool allowReorder = false, bool showReorderColumn = false, bool allowDrag = false, bool allowDrop = false, MhDropMode defaultDropMode = MhDropMode.move, MhItemsViewDragDropModes dragDropMode = MhItemsViewDragDropModes.fullRow, void itemsChanged(List<T> items)?, int getSortPos(T item)?, void setSortPos(T item, int sortPos)?, MhDragMoveResult onDragMove(BuildContext context, MhDragState dragState, T? dropTargetItem)?, MhDragStartResult onDragStart(MhDragState dragState)?, MhAcceptDropResult onAcceptDrop(MhDragState dragState, List<T> droppedItems, T? targetItem)?, void onDropAccepted(MhDragState dragState, List<T> droppedItems, T? targetItem)?})

Properties

allowDrag bool
If true the user can drag the items set allowDrag to true and use allowDragStart to fine tune the check
getter/setter pair
allowDrop bool
If true the user can drop items here Set allowDrop to true and use onDragMove to fine tune the check
getter/setter pair
allowReorder bool
If true the user can reorder the items via drag and drop
getter/setter pair
defaultDropMode MhDropMode
If true the user can drop the items
getter/setter pair
dragDropMode MhItemsViewDragDropModes
Wether the row can be dragged only with the handle displayed by the reorder Column or by grabbing the complete row
getter/setter pair
dropTargetBorderThickness double
How thick the Drop Target Locators should be Drop Target Locators are lines in primary color, to show the user the position where the dragged items will be dropped during the dragDrop operation Default is 5
getter/setter pair
getSortPos int Function(T item)?
If you allow reorder and this function is set, it is used to sort the items If within a treeView the sortPos is used to sort the items within the parent
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
itemsChanged ↔ void Function(List<T> items)?
getter/setter pair
onAcceptDrop MhAcceptDropResult Function(MhDragState dragState, List<T> droppedItems, T? targetItem)?
This function is called if a Drag Drop Action occured from another MhItemsView or another widget This function should - if needed - create the new items from the list of dropped items and return them otherwise the droppedItems are used to be integrated into the list
getter/setter pair
onDragMove MhDragMoveResult Function(BuildContext context, MhDragState dragState, T? dropTargetItem)?
This function is called on the drag target where the dragged items are beeing dragged over Inside this function you should manipulate the dragState. e.g. finetune the allowed Drop Modes according to the items being dragged and the current targetItem
getter/setter pair
onDragStart MhDragStartResult Function(MhDragState dragState)?
This function is called if a Drag Operation is starting Inside this function you can manipulate the dragState. e.g. finetune the allowed Drop Modes according to the items being dragged
getter/setter pair
onDropAccepted ↔ void Function(MhDragState dragState, List<T> droppedItems, T? targetItem)?
This function is called on the source if the target accepted the Drop
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
setSortPos ↔ void Function(T item, int sortPos)?
If you allow reorder this function is used to set the new sort position
getter/setter pair
showReorderColumn bool
if true a column with a reorder icon is shown as the first col (allowReorder needs to be true also)
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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