watchPylon<T> method

Widget watchPylon<T>(
  1. Widget builder(
    1. T data
    )
)

Builds a widget that watches the Stream from the nearest MutablePylon of type T using a StreamBuilder, rendering via the provided builder function with initial data from the current Pylon value or a shrunk widget if no data available.

Implementation

Widget watchPylon<T>(Widget Function(T data) builder) => StreamBuilder<T>(
      stream: streamPylon<T>(),
      initialData: pylonOr<T>(),
      builder: (context, snap) =>
          snap.hasData ? builder(snap.data as T) : const SizedBox.shrink(),
    );