buildWithChild method

  1. @override
Iterable<Component> buildWithChild(
  1. BuildContext context,
  2. Component? child
)
override

A build method that receives an extra child parameter.

This method may be called with a child different from the parameter passed to the constructor of SingleChildStatelessComponent. It may also be called again with a different child, without this component being recreated.

Implementation

@override
Iterable<Component> buildWithChild(BuildContext context, Component? child) {
  return builder(
    context,
    Provider.of<T>(context),
    child,
  );
}