AsyncSubjectManager<T> class
Previously call BaseStream
or BaseExtendBloc
AsyncSubjectManager is a wrap around bloc pattern that use rxdart
AsyncSubjectManager provide a method asyncOperation to handle or call async function associated with rxdart's BehaviorSubject
- Inheritance
-
- Object
- ChangeNotifier
- AsyncSubjectManager
Constructors
-
AsyncSubjectManager({FutureFunction<
T> ? futureFunction, bool reloading = true, SuccessCallBack<T> ? onSuccess, VoidCallback? onDone, ErrorCallBack? onError})
Properties
-
futureFunction
→ FutureFunction<
T> ? -
A future function that return the type of T
final
- hasData → bool
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- onDone → VoidCallback?
-
A function that call after everything is done
final
- onError → ErrorCallBack?
-
A function that call after there is an error
final
-
onSuccess
→ SuccessCallBack<
T> ? -
A function that call after asyncOperation is success
final
-
refresh
↔ Future<
T?> Function({VoidCallback? onDone, ErrorCallBack? onError, SuccessCallBack<T> ? onSuccess, bool? reloading, bool? throwError}) -
getter/setter pair
- reloading → bool
-
if reloading is true, reload the controller to initial state
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stream
→ ValueStream<
T?> -
no setter
- value → T?
-
no setter
Methods
-
addError(
dynamic error) → void - Add error into manager
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
asyncOperation(
FutureFunction< T> futureFunction, {bool? reloading, SuccessCallBack<T> ? onSuccess, VoidCallback? onDone, ErrorCallBack? onError, bool throwError = false}) → Future<T?> - Perform async function in manager
-
dispose(
) → void - dispose everything
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
resetData(
) → Future< void> - Reset everything to starting point
-
toString(
) → String -
A string representation of this object.
inherited
-
updateData(
T data) → T? - Update current data in manager
-
when(
{required Widget ready(T), Widget? loading, Widget error(dynamic)?}) → Widget - handle widget to show with manager state
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited