childrenInstance property

  1. @override
List<ComponentInstance> get childrenInstance
override

Returns the list of runtime child instances.

If this is the first time it’s accessed or after a rebuild, the children are built from the current state and converted into ComponentInstance objects.

Implementation

@override
List<ComponentInstance> get childrenInstance {
  if (_childrenInstances == null) {
    _children ??= state.build();
    _childrenInstances = _children!
        .map((comp) => comp.createInstance())
        .toList();
  }
  return _childrenInstances!;
}