LoaderBloc<Content extends Object> class
BLoC that handles loading and refreshing data
Constructors
-
LoaderBloc({required Stream<
Content> loaderFunction(), Stream<Content> refresherFunction()?, Content? initialContent, void logger(String)?, FlattenStrategy loaderFlattenStrategy = FlattenStrategy.latest, FlattenStrategy refreshFlattenStrategy = FlattenStrategy.first}) -
Construct a LoaderBloc
The
loaderFunction
is a function return a stream ofContent
s (must be not null). It's called when fetch is calledfactory
Properties
- fetch → void Function()
-
Call this function to fetch data
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
message$
→ Stream<
LoaderMessage< Content> > -
Message stream
final
-
refresh
→ Future<
void> Function() -
Call this function to refresh data
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
state$
→ StateStream<
LoaderState< Content> > -
View state stream
final
Methods
-
dispose(
) → Future< void> - Clean up resources
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
reduce<
Content extends Object> (LoaderState< Content> state, LoaderPartialStateChange<Content> change, int _) → LoaderState<Content> -
Return new LoaderState from old
state
and partial statechange