ScrollableSortableLayer constructor
const
ScrollableSortableLayer({
- Key? key,
- required Widget child,
- required ScrollController controller,
- double scrollThreshold = 50,
- bool overscroll = false,
Creates a ScrollableSortableLayer with automatic scrolling support.
Configures a sortable layer that provides automatic scrolling when dragged items approach the edges of the scrollable area.
Parameters:
key(Key?): Widget identifier for the widget treechild(Widget, required): The scrollable widget containing sortable itemscontroller(ScrollController, required): The scroll controller to managescrollThreshold(double, default: 50.0): Distance from edges for scroll triggeroverscroll(bool, default: false): Whether to allow overscroll behavior
Example:
final controller = ScrollController();
ScrollableSortableLayer(
controller: controller,
scrollThreshold: 60.0,
overscroll: true,
child: ListView.builder(
controller: controller,
itemCount: items.length,
itemBuilder: (context, index) => Sortable<Item>(
data: SortableData(items[index]),
child: ItemWidget(items[index]),
),
),
)
Implementation
const ScrollableSortableLayer({
super.key,
required this.child,
required this.controller,
this.scrollThreshold = 50,
this.overscroll = false,
});