Skip to content

Comments

Expose BorderRadius (LTRB) Information in Inspector for RenderDecoratedBox#22

Open
alpinnz wants to merge 1 commit intokekland:masterfrom
alpinnz:feat/inspector-border-radius
Open

Expose BorderRadius (LTRB) Information in Inspector for RenderDecoratedBox#22
alpinnz wants to merge 1 commit intokekland:masterfrom
alpinnz:feat/inspector-border-radius

Conversation

@alpinnz
Copy link

@alpinnz alpinnz commented Feb 11, 2026

PR Description

Overview

This PR adds support for exposing BorderRadius information in the Inspector when inspecting widgets that visually render rounded corners via BoxDecoration.

Previously, the Inspector displayed layout-related properties (size, padding), but did not expose borderRadius data, even when the widget clearly rendered rounded corners.

This improvement enhances Inspector’s usefulness for:

  • UI/UX audits
  • Design token verification
  • Visual consistency validation
  • Design system inspection workflows

What This PR Adds

BorderRadius Extraction (BoxDecoration)

When inspecting a RenderDecoratedBox whose decoration is a BoxDecoration and contains a non-null borderRadius, the Inspector now displays:

Border Radius (LTRB): tl, tr, br, bl

Example

For:

Container(
  decoration: BoxDecoration(
    borderRadius: BorderRadius.circular(8),
  ),
)

Inspector now shows:

Border Radius (LTRB): 8.0, 8.0, 8.0, 8.0

For asymmetric radius:

BorderRadius.only(
  topLeft: Radius.circular(8),
  topRight: Radius.circular(12),
)

Inspector shows:

Border Radius (LTRB): 8.0, 12.0, 0.0, 0.0

Implementation Details

  • Border radius is extracted only from RenderDecoratedBox

  • Decoration must be of type BoxDecoration

  • Defensive checks ensure:

    • decoration is BoxDecoration
    • borderRadius != null
  • BorderRadiusGeometry is resolved using:

    borderRadius.resolve(TextDirection.ltr)
  • Values are formatted explicitly as:

    topLeft, topRight, bottomRight, bottomLeft
    
  • .toString() is not used

  • No changes to rendering or layout behavior

  • No new dependencies introduced


Behavior Changes

Before

Inspector displayed:

  • Size
  • Padding

But did not show:

  • Border radius

After

Inspector additionally displays:

  • Border Radius (LTRB) when available

No existing behavior was removed or modified.


Scope & Limitations

This PR focuses only on:

  • BoxDecoration.borderRadius

It does not yet include:

  • ClipRRect
  • ShapeBorder
  • Material.shape
  • Circle shape extraction

Those may be addressed in a future enhancement if approved.


Backward Compatibility

  • No breaking changes
  • No API changes
  • UI layout remains intact
  • Feature is additive only

Environment Tested

  • Flutter: 3.38.9
  • Platform: Web
  • Inspector version: 3.1.0

Related Issue

Uploading 374311144a1f.mp4…

Closes #21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant