SafeArea constructor

SafeArea({
  1. Object? child,
  2. List<Object?> children = const [],
  3. bool top = true,
  4. bool right = true,
  5. bool bottom = true,
  6. bool left = true,
  7. Object minimum = 0,
  8. String? className,
  9. Map<String, Object?> props = const {},
  10. Map<String, Object?> style = const {},
  11. DartStyle? dartStyle,
})

Creates a safe-area wrapper with optional side controls.

Implementation

SafeArea({
  Object? child,
  List<Object?> children = const [],
  bool top = true,
  bool right = true,
  bool bottom = true,
  bool left = true,
  Object minimum = 0,
  String? className,
  Map<String, Object?> props = const {},
  Map<String, Object?> style = const {},
  DartStyle? dartStyle,
}) : super(
        'div',
        props: mergeComponentProps(
          props,
          className: className,
          dartStyle: DartStyle(
            padding: EdgeInsets.only(
              top: top ? _safeInset('top', minimum) : minimum,
              right: right ? _safeInset('right', minimum) : minimum,
              bottom: bottom ? _safeInset('bottom', minimum) : minimum,
              left: left ? _safeInset('left', minimum) : minimum,
            ),
          ).merge(dartStyle),
          style: style,
        ),
        children: normalizeChildren(child, children),
      );