Skip to content

feat: borderColor and borderWidth on AdaptiveCard - #153

Open
luflow wants to merge 1 commit into
berkaycatak:mainfrom
luflow:feat/card-border-color
Open

luflow wants to merge 1 commit into
berkaycatak:mainfrom
luflow:feat/card-border-color

Conversation

@luflow

@luflow luflow commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

The iOS card always draws a hairline separator around itself. An app that wants its cards outlined in the accent colour — a common way to make a card read as tappable or selected — has to wrap the card in another Container or fork the widget. We had forked it.

Two optional parameters, both defaulting to today's rendering:

AdaptiveCard(
  borderColor: CupertinoTheme.of(context).primaryColor,
  child: …,
)

AdaptiveCard(
  borderColor: CupertinoColors.systemRed,
  borderWidth: 2,
  child: …,
)

Setting borderColor without a width bumps the hairline from 0.5 to 1.0 — at half a point a deliberate colour barely shows, which surprised us when we first tried it. Passing borderWidth explicitly always wins.

Android is untouched: there the border comes from shape, as before.

Demo

card_demo_page gains a "Custom Border (iOS)" section with both cases, right above the existing "Custom Colors".

Testing

flutter analyze clean for package and example, built and run on an iPhone 17 Pro simulator (iOS 26.2) — screenshot of the new section available if useful.

The iOS card always drew a hairline separator, so an app that wants a card
outlined in its accent colour had to wrap the card or fork the widget.

Both parameters are optional and default to today's rendering. Setting
borderColor without a width bumps the hairline to 1.0, so a deliberate
colour is actually visible; Android is unchanged, where the border comes
from shape.
@luflow

luflow commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

Sample:

upstream-card-border-color

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