child method

Widget child(
  1. DurableAnimationController controller,
  2. Widget builder(
    1. BuildContext context,
    2. BloomVia via,
    3. ScopedAnimationController controller,
    4. Widget child,
    ), {
  3. required Widget child,
  4. Key? key,
})

Creates an inline reactive widget bound to a DurableAnimationController with an isolated static child.

Isolates static graphic subtrees into child, ensuring 60/120fps frame-tick rebuilds re-render only the animated wrapper without recalculating or laying out the static child hierarchy.

  • controller: The target durable animation controller.
  • builder: Reactive builder callback receiving BuildContext, BloomVia, ScopedAnimationController, and child.
  • child: The static subtree to preserve across rebuilds.
  • key: Optional widget key.

Requires:

  • builder must be a pure, declarative function.

Ensures:

  • Returns an animated reactive Widget isolating static child from frame-tick rebuilds.

Examples

composed.animate.child(
  controller,
  (context, via, ctrl, child) => RotationTransition(turns: ctrl.view, child: child),
  child: const HeavyComplexIcon(),
);

Implementation

@pragma('vm:prefer-inline')
Widget child(
  DurableAnimationController controller,
  Widget Function(BuildContext context, BloomVia via,
          ScopedAnimationController controller, Widget child)
      builder, {
  required Widget child,
  Key? key,
}) =>
    _ComposedAnimateWithChildWidget(
      controller: controller,
      builder: builder,
      key: key,
      child: child,
    );