unwrap method Null safety

Widget unwrap(
  1. BuildContext context,
  2. Widget widget
)

Unwraps a placeholder if autoUnwrap has been set.

Implementation

static Widget unwrap(BuildContext context, Widget widget) {
  if (widget is WidgetPlaceholder) {
    if (widget._autoUnwrap) {
      return widget.build(context);
    } else {
      return widget;
    }
  } else {
    return widget;
  }
}