insert method

bool insert(
  1. T item,
  2. Point<num> atPoint, {
  3. dynamic id,
})

Implementation

bool insert(T item, Point<num> atPoint, {dynamic id}) {
  if (!containsPoint(atPoint)) return false;
  if (_children.isEmpty) {
    if (_items.length + 1 <= maxItems || _depth + 1 > maxDepth) {
      _items.add(_ItemAtPoint<T>(id, item, atPoint));
      return true;
    }
    _splitItemsBetweenChildren();
  }
  return _insertItemIntoChildren(item, atPoint, id: id);
}