TreeReorderController<TKey, TData> constructor
TreeReorderController<TKey, TData> ({
- required TreeController<
TKey, TData> treeController, - required TickerProvider vsync,
- bool canReorder(
- TKey key
- bool canAcceptDrop({
- int? index,
- required TKey movingKey,
- TKey? newParent,
- Duration slideDuration = const Duration(milliseconds: 220),
- Curve slideCurve = Curves.easeOutCubic,
- double autoScrollEdgeZone = 48.0,
- double autoScrollMaxVelocity = 1200.0,
Implementation
TreeReorderController({
required this.treeController,
required TickerProvider vsync,
this.canReorder,
this.canAcceptDrop,
this.slideDuration = const Duration(milliseconds: 220),
this.slideCurve = Curves.easeOutCubic,
this.autoScrollEdgeZone = 48.0,
this.autoScrollMaxVelocity = 1200.0,
}) {
// Runtime check in all build modes — asserts disappear in release.
if (treeController.comparator != null) {
throw ArgumentError.value(
treeController,
"treeController",
"TreeReorderController is incompatible with a comparator-based "
"TreeController: comparator auto-sort would override drag order. "
"Pass a controller with comparator: null, or remove the comparator.",
);
}
_autoScrollTicker = vsync.createTicker(_onAutoScrollTick);
}