handleSafeArea method

  1. @protected
Widget handleSafeArea(
  1. BuildContext context,
  2. Widget widget,
  3. WidgetNodeSpec spec
)

Handles convenience 'safeArea' property.

Implementation

@protected
Widget handleSafeArea(
    BuildContext context, Widget widget, WidgetNodeSpec spec) {
  final prop = spec.props["wrapSafeArea"] ?? spec.props["safeArea"];
  if (prop is Map) {
    return SafeArea(
      left: parseBool(prop["left"], defaultValue: true),
      top: parseBool(prop["top"], defaultValue: true),
      right: parseBool(prop["right"], defaultValue: true),
      bottom: parseBool(prop["bottom"], defaultValue: true),
      minimum: properties.getInsets(prop["minimum"]) ?? EdgeInsets.zero,
      child: widget,
    );
  } else if (parseBool(prop)) {
    return SafeArea(child: widget);
  }
  return widget;
}