StatefulComponent class abstract
Stateful component with hooks and lifecycle methods
- Inheritance
-
- Object
- DCFComponentNode
- StatefulComponent
- Implementers
Constructors
- StatefulComponent({String? key})
- Create a stateful component
Properties
- contentViewId ↔ String?
-
The native view ID of the rendered content
getter/setter pairinherited
- effectiveNativeViewId → String?
-
Get effective native view ID (may be from rendered content)
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- instanceId → String
-
Unique ID for this component instance
final
- isMounted → bool
-
Get whether the component is mounted
no setter
- key → String?
-
Unique identifier for this node
finalinherited
- nativeViewId ↔ String?
-
Native view ID once rendered
getter/setter pairinherited
- parent ↔ DCFComponentNode?
-
Parent node in the virtual tree
getter/setter pairinherited
- renderedNode ↔ DCFComponentNode
-
Get the rendered node (lazily render if necessary)
getter/setter pairoverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scheduleUpdate ↔ dynamic Function()
-
Function to schedule updates when state changes
getter/setter pair
- typeName → String
-
Type name for debugging
final
Methods
-
clone(
) → DCFComponentNode -
Implement VDomNode methods
override
-
componentDidMount(
) → void -
Called when the component is mounted
override
-
componentDidUpdate(
Map< String, dynamic> prevProps) → void - Called after the component updates
-
componentWillUnmount(
) → void -
Called when the component will unmount
override
-
equals(
DCFComponentNode other) → bool -
Whether this node is equal to another
override
-
mount(
DCFComponentNode? parent) → void -
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
prepareForRender(
) → void - Reset hook state for next render
-
render(
) → DCFComponentNode - Render the component - must be implemented by subclasses
-
runEffectsAfterRender(
) → void - Run effects after render - called by VDOM
-
toString(
) → String -
A string representation of this object.
override
-
unmount(
) → void -
override
-
useEffect(
dynamic Function()? effect(), {List dependencies = const []}) → void - Create an effect hook
-
useRef<
T> ([T? initialValue]) → RefObject< T> - Create a ref hook
-
useState<
T> (T initialValue, [String? name]) → StateHook< T> - Create a state hook
-
useStore<
T> (Store< T> store) → StoreHook<T> - Create a store hook for global state
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited