withSafety static method

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

Implementation

static Widget withSafety(BuildContext context, Widget widget) {
  SafeBar? s = context.pylonOr<SafeBar>();

  if (s != null) {
    return SafeArea(
      top: s.top,
      bottom: s.bottom,
      left: s.left,
      right: s.right,
      child: widget,
    );
  }
  return widget;
}