canMoveChild method

  1. @override
bool canMoveChild(
  1. WidgetData child,
  2. Direction direction
)
override

Implementation

@override
bool canMoveChild(WidgetData child, Direction direction) {
  switch (direction) {
    case Direction.left:
      return child.index() > 0;

    case Direction.right:
      return child.index() < children.length - 1;

    case Direction.up:
    case Direction.down:
      return false;
  }
}