load method
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'));
}
}
}