Explorar o código

add toList back

xuty %!s(int64=4) %!d(string=hai) anos
pai
achega
c41af1f862
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      lib/utli/circular_list.dart

+ 4 - 2
lib/utli/circular_list.dart

@@ -1,5 +1,3 @@
-import 'dart:collection';
-
 class CircularList<T> {
 class CircularList<T> {
   CircularList(int maxLength) : _array = List<T?>.filled(maxLength, null);
   CircularList(int maxLength) : _array = List<T?>.filled(maxLength, null);
 
 
@@ -173,4 +171,8 @@ class CircularList<T> {
   }
   }
 
 
   bool get isFull => length == maxLength;
   bool get isFull => length == maxLength;
+
+  List<T> toList() {
+    return List.generate(length, (index) => this[index]);
+  }
 }
 }