replaceLast method

void replaceLast(
  1. T element
)

Implementation

void replaceLast(T element) {
  if (isUnfilled) {
    assert(_start == 0, 'Internal buffer grown from a bad state');
  }

  this[_normalizeIndex(_buf.length - 1)] = element;
  _notifyListeners();
}