HelpUIApproach class
UI Approach
Declarative
string = 'Hello World'
build() {
return Text(string) // text gets destroyed and rebuilt
}
- Updating text on screen can be done by mutating state outside of build
- e.g., string = string + ! builds HelloWorld!
Imperative
build() {
return Text.setText('Hello World') // text does not get destroyed, value gets updated
}
- Updating text on screen must be done by accessing current UI state before mutating UI
- e.g., Text.setText(Text.getText+"!") builds HelloWorld!
Properties
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
toString()
→ String
-
A string representation of this object.
inherited