TreeReorderController<TKey> constructor

TreeReorderController<TKey>({
  1. required TreeController<TKey, Object?> treeController,
  2. required TickerProvider vsync,
  3. bool canReorder(
    1. TKey key
    )?,
  4. bool canAcceptDrop({
    1. int? index,
    2. required TKey movingKey,
    3. TKey? newParent,
    })?,
  5. void onReorder(
    1. TKey key,
    2. TKey? newParent,
    3. int index
    )?,
  6. double autoScrollEdgeZone = 48.0,
  7. double autoScrollMaxVelocity = 1200.0,
  8. Duration? autoExpandDelay = const Duration(milliseconds: 700),
})

Implementation

TreeReorderController({
  required this.treeController,
  required TickerProvider vsync,
  this.canReorder,
  this.canAcceptDrop,
  this.onReorder,
  this.autoScrollEdgeZone = 48.0,
  this.autoScrollMaxVelocity = 1200.0,
  this.autoExpandDelay = const Duration(milliseconds: 700),
}) {
  // Runtime check in all build modes: asserts disappear in release.
  // hasComparator, not comparator: reading the comparator getter through
  // this class's covariant `TreeController<TKey, Object?>` view throws a
  // TypeError (TData appears contravariantly in its function type).
  if (treeController.hasComparator) {
    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.",
    );
  }
  _vsync = vsync;
}