Ask the assistant
0/400
Your question is processed by an AI service and kept to improve answers. Do not enter personal data.

    ClipRRect

    Clips its child to a rounded rectangle. Used to round the corners of images and containers.

    Type: single-child

    ClipRRect
      #borderRadius circular 20
      Image src:"https://example.com/poster.jpg" fit:cover

    Parameters

    Parameter Type Default Description
    clipBehavior string antiAlias Clip mode: none , hardEdge , antiAlias , antiAliasWithSaveLayer

    Nested structures

    #borderRadius

    // The same radius on every corner
    #borderRadius circular 20
    
    // Only some corners
    #borderRadius only topLeft:20 topRight:20 bottomLeft:0 bottomRight:0

    Examples

    Rounded image

    SizedBox width:512 height:288
      ClipRRect
        #borderRadius circular 20
        Image src:"https://example.com/poster.jpg" fit:cover

    Card rounded at the top

    ClipRRect
      #borderRadius only topLeft:16 topRight:16
      Column
        Image src:"https://example.com/cover.jpg" fit:cover
        Padding
          #padding all 12
          Text "Description"

    See also

    • DecoratedBox — rounding through #borderRadius in #decoration (without clipping the content)