tabs.dart 429 B

12345678910111213141516171819202122232425262728
  1. class Tabs {
  2. final _stops = <int>{};
  3. void setAt(int index) {
  4. _stops.add(index);
  5. }
  6. void clearAt(int index) {
  7. _stops.remove(index);
  8. }
  9. void clearAll() {
  10. _stops.clear();
  11. }
  12. bool isSetAt(int index) {
  13. return _stops.contains(index);
  14. }
  15. void reset() {
  16. clearAll();
  17. const maxTabs = 1024;
  18. const tabLength = 4;
  19. for (var i = 0; i < maxTabs; i += tabLength) {
  20. setAt(i);
  21. }
  22. }
  23. }