load method

Future<void> load(
  1. Future<S> future
)

Implementation

Future<void> load(Future<S> future) async {
  setLoading();
  try {
    add(await future);
  } catch (e) {
    if (e is Exception) {
      setError(error: e);
    } else {
      setError(error: Exception('Unknown error'));
    }
  }
}