load method

Future<void> load()

Seeds from cache (shown as stale) then refreshes from the Hub. Safe to call on every navigation to the nodes screen.

Implementation

Future<void> load() async {
  if (!state.value.hasData) {
    final cached = _cache.read();
    if (cached != null && cached.isNotEmpty) {
      state.value = AsyncState.loading(data: cached, stale: true);
    }
  }
  await refresh();
}