ActiveController class abstract
ActiveController ActiveController is an abstraction of the ActiveView bounded. ActiveController handles current state of active types in ActiveView.
Business Logic should exist here and data is easily accessed from the ActiveView through the assigned activeController.
When an update occurs on an active type, the events are automatically emitted, The ActiveState bound to the ActiveController will update itself everytime an ActiveType value is updated and initiate a build.
Constructors
Properties
- actively → bool
-
no setter
- activeTasks → List
-
no setter
-
activities
→ Iterable<
ActiveType> -
Contains list of ActiveType values in ActiveController.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
activateTypes(
List< Map< activeTypeList) → voidActiveType, dynamic> > - activateTypes allows multiple ActiveType to be updated at once and it will only trigger a single state change.
-
activeAsync<
T> (Future< T> task(), {dynamic isRunningKey}) → Future<T> - Use this function when you have a long running task asynchronously. it handles setting actively status from true to false once done.
-
addOnStateChangedListener(
dynamic onStateChanged(List< ActiveStateChanged> events)) → StreamSubscription - Event handler for ActiveType when values get updated
-
cancelSubscription(
StreamSubscription? subscription) → Future< void> - Cancels events subscription.
-
isTaskRunning(
dynamic isRunningKey) → bool - Use this when you intend to check if actively is true
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyActivities(
List< ActiveStateChanged> events) → void - Initiates ActiveState when UI needs updating.
-
onActiveError(
ErrorEvent event) → void - Alerts ActiveState that an error has occurred. all listeners registered by theonActiveErrorListener function will be executed
-
onActiveErrorListener(
dynamic onError(ErrorEvent event)) → StreamSubscription - Event handler when there is a onActiveError.
-
resetActivities(
) → void - Use this when you want to clear current state & event listeners that are connected and are active.
-
resetAllActiveTypes(
) → void - Factory reset. This resets every activeType property defined in activities list
-
setIdle(
{dynamic isRunningKey}) → void -
Updates the current ActiveController status to false.
You can specify the ActiveController by passing the
isRunningKey
Updates the current ActiveController status to true. -
setRunning(
{required String isRunningKey}) → void -
Updates the current ActiveController status to true.
You can specify the ActiveController by passing the
isRunningKey
Updates the current ActiveController status to true. -
setRunningStatus(
{required bool isRunning, required String isRunningKey}) → void - Updates the current ActiveController status.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited