Please enable JavaScript.
Coggle requires JavaScript to display documents.
Flutter - 101, Trees - Coggle Diagram
Flutter - 101
Widget
Widget/Element Tree
-
Stateful widget
Stateful widget keeps , long life span: remain attached element tree even when the original widget gets replaced by a new one. (as long as the new one is the same type)
Inherited Widgets
Pass data descendant. You can only replace an inheritedWidget's field by rebuilding the whole widget
Final only means it can't be reassigned. It does not mean it cannot change internally, you can attach a service (i.e) that can have its own internal state
Element
-
-
For every widget, Flutter builds a corresponding element
Key
-
When
Most of time, adding, removing, ordering collection of widgets in your widget state. (todo app, remove, add, order)
If your entire subtree in your collection of widgets is stateless, keys aren't needed
-
Which one
collections: only different keys, too list: use text value as key, or use a id from db / uniquekey, dont use a random number
Global keys
-
they can be used ti access information about another widget in a complete different part of the widget tree
-
-
Trees
-
Element
Mutable piece, an instantiation of a Widget at a particular location in the tree.
RenderObject
handles size, layout, and painting
-
-