getListData method

  1. @override
Future<IList<T>?> getListData({
  1. bool autoClose = false,
})
override

Implementation

@override
Future<IList<T>?> getListData({
  bool autoClose = false,
}) async {
  try {
    IList<T> data = <T>[].lock;
    for (int x = 0; x < _box!.length; x++) {
      final T? item = _box!.getAt(x);
      if (item != null) {
        data = data.add(item);
      }
    }

    return data;
  } catch (e) {
    rethrow;
  } finally {
    if (autoClose) {
      await close();
    }
  }
}