child<T> method
Creates an inline reactive widget driven by a continuous frame ticker with an isolated static child.
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, andchild.child: The static subtree 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
child.
Examples
composed.drive.child<double>(
(elapsed) => (elapsed.inMicroseconds % 1000000) / 1000000.0,
(context, via, progress, child) => Transform.rotate(
angle: progress * 2 * math.pi,
child: child,
),
child: const HeavyDialGraphic(),
);
Implementation
@pragma('vm:prefer-inline')
Widget child<T>(
T Function(Duration elapsed) onTick,
Widget Function(BuildContext context, BloomVia via, T value, Widget child)
builder, {
required Widget child,
Key? key,
}) =>
_ComposedDriveWithChildWidget<T>(
onTick: onTick,
builder: builder,
key: key,
child: child,
);