SortableData<T> class
Immutable data wrapper for sortable items in drag-and-drop operations.
SortableData wraps the actual data being sorted and provides identity for drag-and-drop operations. Each sortable item must have associated data that uniquely identifies it within the sorting context.
The class is immutable and uses reference equality for comparison, ensuring that each sortable item maintains its identity throughout drag operations. This is crucial for proper drop validation and handling.
Type parameter T represents the type of data being sorted, which can be
any type including primitive types, custom objects, or complex data structures.
Example:
// Simple string data
SortableData<String>('item_1')
// Complex object data
SortableData<TodoItem>(TodoItem(id: 1, title: 'Task 1'))
// Map data
SortableData<Map<String, dynamic>>({'id': 1, 'name': 'Item'})
- Implementers
- Annotations
Constructors
- SortableData(T data)
-
Creates a SortableData wrapper for the given data.
const
Properties
- data → T
-
The actual data being wrapped for sorting operations.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override