ActionFactory class
Class that handles Action related operations.
Constructors
Properties
- appContext → BuildContext
-
no setter
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- log → Logger
-
final
- properties → PropertyFactory
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- widgets → WidgetFactory
-
no setter
Methods
-
createListBloc(
) → ListBloc -
createLocalBloc(
) → LocalBloc -
execute(
NodeSpec action, ActionContext context) → Future< ActionResult> -
The
action
's actual execution. -
executePageLoadAction(
BuildContext buildContext, ListBloc bloc, int page, int pageSize, List fullData, Map? actionSpec, Map state, Map? actionContext, {dynamic value}) → void - Executes a PageLoadFunction
-
getEvaluatorContext(
Object? value, Map state, Map? specContext) → Map - Returns a Map with the evaluation context used when sanitizing properties of a NodeSpec. Used to resolve properties that use placeholders as values, like "${state.firstName}" or "${env.api_uri}".
-
getFunction(
BuildContext context, dynamic actionSpec, Map state, Map? evaluatorContext) → ActionFunction? -
Returns a ActionFunction that executes an Action based on it's
actionSpec
. -
getHttpDefaultHeaders(
{String? contentType, Map< String, String> ? otherHeaders}) → Map<String, String> - Method used to make Http calls. Conveniently placed in this class to facilitate overrides.
-
getPageLoadResolver(
String type) → PageLoadFunction< LoadPageActionEvent, PageLoadedState> ? -
Returns a PageLoadFunction for a give PageAction
type
. -
getResolver(
String type) → Function? -
Returns a Function for a give Action
type
. -
getValueFunction<
T> (BuildContext context, dynamic actionSpec, Map state, Map? evaluatorContext) → ActionValueFunction< T> ? -
Returns a ActionValueFunction<T> that executes an Action based on it's
actionSpec
. -
handleException(
NodeSpec action, ActionContext context, Object e) → Future< RetryAction> -
Exception handling when executing an
action
-
httpCall(
Uri uri, String method, {Object? body, Map< String, String> ? headers, Encoding? encoding}) → Future<HttpResponse> - Method used to make Http calls. Conveniently placed in this class to facilitate overrides.
-
loadActions(
IActions actions) → void - Schema loading
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onExecuted(
) → void - Method executed after executing an Action. Removes an activity indicator.
-
onExecuting(
) → void - Method executed immediately before executing an Action. Launches an activity indicator.
-
onHttpError(
HttpResponse response, NodeSpec action, ActionContext context) → Future< RetryAction> - Method used to handle Http errors. Conveniently placed in this class to facilitate overrides.
-
onHttpSuccess(
HttpResponse response, NodeSpec action, ActionContext context) → HttpActionResult - Method used to handle a successful Http call. Conveniently placed in this class to facilitate overrides.
-
postExecute(
NodeSpec action, ActionResult result, ActionContext context) → Future< NodeSpec?> -
Handles the ActionResult of an executed
action
and determines the next Action to be executed if any. -
preExecute(
NodeSpec action, ActionContext context) → Future< bool> - An initial run of validations before executing an Action. E.g.: a confirmation message like "Are you sure you want to delete this record?".
-
preRun(
BuildContext context, Map actionProps) → Future< bool> - An initial run of validations upon starting a run. E.g.: form validation.
-
run(
BuildContext buildContext, NodeSpec action, Map state, Object? eventValue, Map? actionContext) → Future< void> -
Starts the execution of an
action
-
showErrorMessage(
String message) → void - Convenience method to display an error method to the user.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited