SortableLayer constructor
const
SortableLayer({})
Creates a SortableLayer to manage drag-and-drop operations.
Configures the layer that coordinates drag sessions between sortable widgets and provides the rendering context for drag operations.
Parameters:
key(Key?): Widget identifier for the widget treechild(Widget, required): The widget tree containing sortable widgetslock(bool, default: false): Whether to constrain dragging within boundsclipBehavior(Clip?, optional): How to clip the layer contentdropDuration(Duration?, optional): Duration for drop animationsdropCurve(Curve?, optional): Curve for drop animation easing
Example:
SortableLayer(
lock: true,
dropDuration: Duration(milliseconds: 250),
dropCurve: Curves.easeInOutCubic,
child: ListView(
children: sortableItems.map((item) => Sortable(...)).toList(),
),
)
Implementation
const SortableLayer({
super.key,
this.lock = false,
this.clipBehavior,
this.dropDuration,
this.dropCurve,
required this.child,
});