next method
Implementation
@override
VideoDetail next() {
index += 1;
if (cacheVideoQueue.length < cacheSize / 2) {
cacheData(urlPath,
pageNo: (index / cacheSize).ceil(), pageSize: cacheSize);
}
if (cacheVideoQueue.length < cacheSize / 2) {
index = 0;
cacheData(urlPath,
pageNo: (index / cacheSize).ceil() + 1, pageSize: cacheSize);
}
if (cacheVideoQueue.isNotEmpty) {
return cacheVideoQueue.removeFirst();
} else {
return VideoDetail();
}
}