toSliver method

Widget toSliver(
  1. BuildContext context, {
  2. bool fillRemaining = false,
  3. bool softWarn = true,
})

Implementation

Widget toSliver(BuildContext context,
    {bool fillRemaining = false, bool softWarn = true}) {
  if (isSliver(context)) {
    return this;
  }

  warn(
      "$runtimeType is not a sliver in a sliver context, wrapping in a ${fillRemaining ? "SliverFillRemainingBoxAdapter" : "SliverToBoxAdapter"}");
  return fillRemaining
      ? SliverFillRemainingBoxAdapter(child: this)
      : SliverToBoxAdapter(child: this);
}