all property

Implementation

List<LocalCacheObject> get all {
  List<FileSystemEntity> list = directory.listSync();
  List<LocalCacheObject> targetList = [];
  for (var file in list) {
    if (file is File) {
      CacheType type = CacheType.json;
      if (file.path.endsWith('.json')) type = CacheType.json;
      if (file.path.endsWith('.txt')) type = CacheType.plain;
      if (file.path.endsWith('.byte')) type = CacheType.raw;
      targetList.add(
        LocalCacheObject(
          file.path.split('/').last.split('.').first,
          channel: channel,
          type: type,
        ),
      );
    }
  }
  return targetList;
}