initialize method
Implementation
@protected
void initialize() {
void onSuccess(result) => emit(AutoListReadyState(result));
void onError(e, t) => emit(AutoListErrorState(e, t));
try {
if (provider is DataProvider<T>) {
(provider as DataProvider).call().then(onSuccess, onError: onError);
} else if (provider is StreamDataProvider) {
(provider as StreamDataProvider).call().listen(onSuccess, onError: onError);
}
} catch (error, trace) {
onError(error, trace);
}
}