Widgets

/

layout

SafeArea

Pads its object away from device notches and system bars.

Clear of notches and system bars

SafeArea pads its object by the device's safe-area insets: the notch, the rounded corners and the home indicator of a phone. On a screen without them the padding is zero, so this preview looks the same with or without it; open the page on a phone held sideways to see the difference.

LAYR
SafeArea(
  .config(edges: x)
  .obj(
    Row(
      .config(
        w: fill
        color: panel
        cornerRadius: 12
        padding: all(14)
        xAlign: between
        yAlign: mid
      )
      Text(.config(weight: semibold) .obj('Room B'))
      Text(.config(color: muted) .obj('Available'))
    )
  )
)

edges chooses which sides: all (the default), top, bottom, x (left and right) or y (top and bottom). A Scaffold already keeps its content inside the safe area, so SafeArea is for full-bleed parts you place yourself.

Config keys

KeyTypeDefaultMeaning
edgesall | top | bottom | x | yallWhich edges to protect.
margininsetsSpace outside the object: all(8), sym(x: 8, y: 4), only(top: 8).
opacitynumOpacity from 0 to 1.
hide (hidden)boolRemoves the object from layout and the accessibility tree.
shrinknum1Shrink priority when space runs out. Lower shrinks first; 0 never shrinks.
flexnum1Share of remaining space for fill sizes.
cursorauto | pointer | text | grab | grabbing | move | notAllowed | crosshair | nonePointer cursor.
className (class)txtExtra CSS class names: styling hooks for your own stylesheet (hover rules, third-party CSS).

Slots

  • .obj: one object, the default slot