loadMore method
Loads the next page of older entries if there is one and no other load is running. Safe to call on every scroll event.
Implementation
Future<void> loadMore() async {
final window = _window;
final next = window.next;
if (next == null || window.isQuerying || _loadMoreError != null) return;
window.beginQuery();
notifyListeners();
try {
final page = await reader.queryEntries(next);
if (_isDisposed || !identical(window, _window)) return;
window.completeQuery(page);
notifyListeners();
} on Object catch (error, stack) {
_report('LogViewerController: failed to load more logs', error, stack);
if (_isDisposed || !identical(window, _window)) return;
window.failQuery();
_loadMoreError = error;
notifyListeners();
}
}