v0.13.0
circular_buffer
A Dart Circular Buffer container based on List with a fixed capacity.
7Likes 90.5K30-day downloads160Pub points
AndroidiOSWebmacOSWindowsLinux
A circular buffer container for Dart
English project snapshot. Visit GitHub for the latest content.
A circular buffer with a fixed capacity. Supports most List read operations and a fixed-size write interface (add, addHead, clear).
final buffer = CircularBuffer<int>(3)..add(1)..add(2);
print(buffer.length); // 2
print(buffer.first); // 1
print(buffer.isFilled); // false
print(buffer.isUnfilled); // true
buffer.add(3);
print(buffer.length); // 3
print(buffer.isFilled); // true
print(buffer.isUnfilled); // false
buffer.add(4);
print(buffer.first); // 2
buffer.addHead(4);
print(buffer.length); // 3
print(buffer[0]); // 4
print(buffer[1]); // 2
print(buffer[2]); // 3
Dependency list 2 items
^1.25.8^10.2.0Start with your use case, compare repository activity, and check the original project before adopting it.
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗