Optional_Identifies this object as an observer of other observables. Assigned on first use.
Private OptionalcontractThe contract name, shared by every client's model for this screen.
PrivatefocusThe focus target this model last asked for, or '' for none. Setting it asks the view to move focus there, every time, even to the same target. It is a view id, never a node or a coordinate.
This is a request, not the current focus. To follow where focus is,
override focused.
Stop in-flight work without leaving the screen.
The screen is gone. Later results must be ignored.
The view reports that focus moved to target for a reason other than this
model asking: the user navigated, or the view restored focus. A focus move
this model requested through focus is not reported back.
What a tool sees: name, current state and available actions.
A key reached the view that holds this model without a focused control handling it first.
The key, as a Key value such as 'back' or 'play'.
true for the press, false for the release.
true if this model handled the key; the view and its parents then ignore it.
Reusable
Sends a contract action by name, as a tool or a test does.
false when there is no such action.
Load again on request; also the retry after a failure.
Observing other observables
@observable(['fieldA', 'fieldB']) other!: OtherObservable on an
HsObservable subclass observes those fields of other, the same way the
decorator does on a view. Changes arrive in onObservableFieldUpdated.
OptionalfieldFilters: string[]The screen is visible again. Restart what suspend stopped.
Optionalcontext: unknownObserves again after dispose(), using the objects currently held in the @observable fields.
Assignment to an @observable field: observe the new object and notify this object's own observers.
The screen is shown for the first time. context is what only the view knows, such as layout.
Optionalcontext: unknownThe screen is no longer visible but still exists. Stop in-flight work.
Optionalvalue: HsObservable
Screen behaviour that lives outside its view.
The lifecycle methods are the shared vocabulary every client uses:
start,suspend,resume,refresh,cancel,dispose. A view that holds a model inviewModelsends them itself; a test or a command-line host sends the same ones throughperform. Do not add other names for these events.Declare what a view may read and send in
describeContract. State is@observableFields on the subclass.