Widget class Null safety

Flutter-like widgets for building UIs with HTML elements. Define the build method to create a new widget.

class NotFoundPage extends Widget {
  @override
  Element build() => paragraphElement(text: '404: Not found');
}
Implementers

Constructors

Widget()

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
mounted bool
Checks if this widget instance is still mounted to the DOM.
read-only
parent Widget?
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

addPostSetStateCallback(Function callback) → void
Perform some action after setState has been called.
appendTo(Widget parent) Element
Use this method inside of the build method of the parent widget to append this widget to it. This creates a widget tree and makes it possible to use the findParent() and setState() method.
build() Element
Method which needs to be defined by the developer to describe the UI using HTML Elements. It is not recommended to use this method to append your widget in the build method of another widget! Use appendTo for this!
findParent<T>() → T
Looks up the widget tree until it finds a parent of this type or otherwise throws an exception. Make sure that this widget has been appended by the appendTo() method first.
initState() → void
Override this method to initialize the state of this widget. The parent value is already set when this method is called.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
setState(void fun()) → void
Similar to the Flutter equivalent this changes the state of this widget and rebuilds the UI and all underlying widgets. Make sure that this widget has been appended by the appendTo() method first.
toString() String
A string representation of this object. [...]
override

Operators

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