addItem method

  1. @internal
bool addItem(
  1. int index,
  2. AnimationController controller
)

Adds an item at the given index, returning true if added.

Implementation

@internal
bool addItem(int index, AnimationController controller) {
  if (controller.value == 1 && _max != null && _max <= _expanded.length) {
    return false;
  }

  controllers[index] = controller;
  if (controller.value == 1) {
    _expanded.add(index);
  }

  return true;
}