call method

Widget call(
  1. Widget builder(
    1. BuildContext context,
    2. BloomVia via,
    3. TickerProvider vsync
    ), {
  2. Key? key,
})

Creates an inline reactive widget providing an element-managed TickerProvider (vsync).

Allocates a dedicated TickerProvider on the host element, eliminating the need for StatefulWidget and SingleTickerProviderStateMixin. Automatically synchronizes with Flutter's TickerMode to pause tickers when dormant and disposes cleanly upon unmount.

Requires:

  • builder must be a pure, declarative function.

Ensures:

Examples

composed.vsync((context, via, vsync) {
  return LiveClockWidget(vsync: vsync);
});

Implementation

@pragma('vm:prefer-inline')
Widget call(
  Widget Function(BuildContext context, BloomVia via, TickerProvider vsync)
      builder, {
  Key? key,
}) =>
    _ComposedVsyncWidget(builder, key: key);