UserInterface class

A UserInterface is a List of root Components and optional globalState.

Upon initialization, every Component is rendered as an HTML Element.

Constructors

UserInterface({@required List<Component> components, Map<String, dynamic> globalState})
Creates a new UserInterface with optional globalState.

Properties

components List<Component>
The components List includes every root Component that will be rendered in the UI.
read / write
globalState Map<String, dynamic>
The globalState Map identifies UI-level properties that can affect every Component. Common keys: loggedIn, userRole, nightMode.
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

getGlobal(String key) → dynamic
getGlobal gets a property from the globalState Map. If globalState is null or key does not exist, throws an exception.
initialize() Element
initialize renders every root Component in the UserInterface for the first time. The results can easily be inserted into an HTML document: document.getElementById("...").replaceWith(UI.initialize());
setGlobal(String key, dynamic value) → void
setGlobal sets a property on the in the globalState Map, then re-renders every Component in the UI. If globalState is null or key does not exist, throws an exception.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited