insertSafe method

bool insertSafe(
  1. int index,
  2. T element
)

插入指定元素

Implementation

bool insertSafe(int index, T element) {
  if (isNull) return false;
  if (index < 0 || index >= this!.length) return false;
  this!.insert(index, element);
  return true;
}