toBox method

Widget toBox(
  1. BuildContext context, {
  2. bool softWarn = true,
})

Implementation

Widget toBox(BuildContext context, {bool softWarn = true}) {
  if (isSliver(context)) {
    warn(
        "$runtimeType is a sliver in a box context, wrapping in a shrink-wrapped CustomScrollView");
    return CustomScrollView(
      shrinkWrap: true,
      physics: NeverScrollableScrollPhysics(),
      slivers: [this],
    );
  }
  return this;
}