children method
Creates an inline reactive widget with isolated static children subtrees.
Prevents redundant widget reconstructions in multi-child layouts (Row, Column, Stack)
where layout properties are reactive but children remain static.
builder: Reactive builder callback receiving BuildContext, BloomVia, and cachedchildren.children: The static subtrees to preserve across rebuilds. Must not be null.key: Optional widget key.
Requires:
buildermust be a pure, declarative function.
Ensures:
- Returns a reactive Widget preserving
childrenacross dependency-driven rebuilds.
Examples
composed.children(
(context, via, children) => Row(
mainAxisAlignment: via(alignmentBloom),
children: children,
),
children: const [SidebarWidget(), MainContentWidget()],
);
Implementation
@pragma('vm:prefer-inline')
Widget children(
Widget Function(BuildContext context, BloomVia via, List<Widget> children)
builder, {
required List<Widget> children,
Key? key,
}) =>
_ComposedWithChildrenWidget(
builder: builder,
key: key,
children: children,
);