StatefulData<T> constructor
StatefulData<T> ({})
Creates an instance of StatefulData.
A loader
function for single data loading must be provided.
If startLoading
is 'true', that is default behavior, then data loading is
started immediately on creating the object.
Implementation
StatefulData({
required Future<T?> Function() loader,
this.isEmptyValidator = _defaultIsEmptyValidator,
bool startLoading = true,
}) {
_loader = loader;
_source = null;
if (startLoading) {
loadData();
}
}