buildNullable method

Widget buildNullable({
  1. WidgetDataBuilder<T?>? builder,
  2. bool isSliver = false,
  3. WidgetBuilder? loadingBuilder,
  4. SimpleWidgetBuilder? simpleLoader,
  5. T? initial,
  6. bool? crossFade,
  7. Key? key,
})

Implementation

Widget buildNullable(
    {WidgetDataBuilder<T?>? builder,
    bool isSliver = false,
    WidgetBuilder? loadingBuilder,
    SimpleWidgetBuilder? simpleLoader,
    T? initial,
    bool? crossFade,
    Key? key}) {
  return StreamBuilder<T>(
    key: key,
    stream: this,
    builder: (context, snap) {
      return snap.render(
        context,
        isSliver: isSliver,
        crossFade: crossFade,
        builder: (data, _) => builder!(data),
        loadingFn: simpleLoader ??
            (loadingBuilder == null
                ? kLoader
                : () => loadingBuilder(context)),
        allowNull: true,
      );
    },
    initialData: initial,
  );
}