RingBuffer<T> constructor
RingBuffer<T> (
- int capacity
Creates a RingBuffer with the specified capacity.
Implementation
RingBuffer(int capacity)
: _capacity = capacity,
_buffer = List<T?>.filled(capacity, null) {
if (capacity <= 0) {
throw ArgumentError('Capacity must be greater than 0');
}
}