children<T> method
Creates an inline reactive widget driven by a continuous frame ticker with isolated static children.
onTick: Callback converting frame elapsed duration to state of typeT. Evaluated synchronously with Duration.zero to seed initial state, and subsequently on frame ticks.builder: Reactive builder callback receiving BuildContext, BloomVia, current driven valueT, andchildren.children: The static subtrees to preserve across frame ticks.key: Optional widget key.
Requires:
onTickmust be a pure conversion function.
Ensures:
- Returns an inline reactive Widget driven by frame ticks while isolating
children.
Examples
composed.drive.children<double>(
(elapsed) => (elapsed.inMilliseconds % 500) / 500.0,
(context, via, progress, children) => Opacity(
opacity: progress,
child: Row(children: children),
),
children: const [BadgeWidget(), LabelWidget()],
);
Implementation
@pragma('vm:prefer-inline')
Widget children<T>(
T Function(Duration elapsed) onTick,
Widget Function(
BuildContext context, BloomVia via, T value, List<Widget> children)
builder, {
required List<Widget> children,
Key? key,
}) =>
_ComposedDriveWithChildrenWidget<T>(
onTick: onTick,
builder: builder,
key: key,
children: children,
);