ScreenActionContext class

The ActionContext of one screen: its variables (over the route's params and the app's data), services, UI and node tree. The app can set variables no screen declares (RuntimeActionContext.declareMissing). On a paywall's screen, its paywall actions act on paywall.

Inheritance

Constructors

ScreenActionContext({required ValueScope scope, required ExpressionEngine expressions, required CodelesslyServices? services, required ActionUi ui, Map<String, AppFunction> functions = const {}, RenderTree? tree, NodeValues? nodeValues, void onError(Object error, StackTrace stack, String? action)?, void onActionErrorEvent(Json event)?, void refreshAuthValues(AuthOperation operation)?, AppDataSources? appData, PaywallSession? paywall, Future<PaywallResult> openPaywall(String placement)?, Future<PaywallResult> presentPaywall(String placement, PaywallPresentation presentation)?, List<ScriptDef> scripts = const []})

Properties

appData → AppDataSources?
The app's shared live data (loadCloudData with scope: app); null: such loads are the screen's.
finalinherited
declareMissing → bool
Whether setVariable declares a variable no scope declares (the app setting values), on the nearest variable scope. Actions only set declared variables.
finalinherited
disposers → List<VoidCallback>
What onDispose registered: shared by this context's copies (copy).
no setterinherited
expressions → ExpressionEngine
finalinherited
extensions → List<Object>
What the app shell attaches for its features' handlers, found by type (extension): the core carries them without reading them.
finalinherited
failed → FailedActions
The failed action chain the screen's actionError reaction can run again (retryFailed); shared by this context's copies.
finalinherited
functions → Map<String, AppFunction>
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
nodeValues → NodeValues?
Where set value and set variant actions put node values.
finalinherited
onActionErrorEvent → void Function(Json event)?
Authored canvas error reactions; separate from the host's raw error callback. Omitted while running an error reaction to prevent recursion.
finalinherited
onError → void Function(Object error, StackTrace stack, String? action)?
Gets the errors of failed actions; null: logged to the services' analytics when they have it, else printed.
finalinherited
openPaywall → Future<PaywallResult> Function(String placement)?
Opens a server-resolved placement; supplied by the app shell.
finalinherited
paywall → PaywallSession?
The paywall a paywall screen's actions act on.
finalinherited
presentPaywall → Future<PaywallResult> Function(String placement, PaywallPresentation presentation)?
Opens a placement as PaywallPresentation says (the openPaywall action's transition); supplied by the app shell. Without it, openPaywall opens it with the default transition.
finalinherited
refreshAuthValues → void Function(AuthOperation operation)?
Synchronizes host-owned auth values after a completed native operation, before the next authored action reads them. Expression reads stay pure.
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scope → ValueScope
finalinherited
scripts → List<ScriptDef>
The scripts its run script actions run (the layout's).
finalinherited
services → CodelesslyServices
finalinherited
tree → RenderTree?
The screen's node tree (scroll to a node, its text fields).
finalinherited
ui → ActionUi
finalinherited

Methods

copy(ValueScope scope, {bool suppressErrorEvents = false}) → RuntimeActionContext
This context over scope (without its error events, with suppressErrorEvents). A subclass overrides it to stay itself.
inherited
dispose() → void
Runs what onDispose registered.
inherited
extension<T extends Object>() → T?
The attachment of type T, if any.
inherited
Navigation (implemented by the app shell).
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onDispose(VoidCallback callback) → void
Runs when the screen goes (cloud data streams a load action opened).
inherited
reportError(Object error, StackTrace stack, {String? action}) → void
Reports an action that failed (its chain stopped).
inherited
setVariable(String name, Object? value) → void
Sets variable name (or a path into one: draft.title, rows[1]) in the scope that declares it; the boxes that read it re-apply.
inherited
toString() → String
A string representation of this object.
inherited
withoutActionErrorEvents() → RuntimeActionContext
An error reaction keeps the same services, variables and host error callback, but cannot recursively dispatch more authored error events.
inherited
withScope(ValueScope scope) → RuntimeActionContext
This context reading from scope (a list item's) instead.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited