Add non uniform TableBorder by korca0220 · Pull Request #172441 · flutter/flutter

@github-actions bot added the framework

flutter/packages/flutter repository. See also f: labels.

label

Jul 21, 2025

Piinks

Piinks

Piinks

Piinks

Piinks

Piinks

Piinks

justinmc

@Piinks Piinks added the autosubmit

Merge PR when tree becomes green via auto submit App

label

Sep 22, 2025

korca0220 added a commit to korca0220/flutter that referenced this pull request

Sep 22, 2025
Recreates the implementation from PR flutter#172441 on a clean branch
after resolving rebase issues. Enables border radius when outer
border sides have uniform colors but different widths/styles.

Also adds inflateRRect and deflateRRect methods to EdgeInsets
for consistent handling of rounded rectangles.

korca0220 added a commit to korca0220/flutter that referenced this pull request

Sep 22, 2025

Piinks pushed a commit to korca0220/flutter that referenced this pull request

Sep 22, 2025
Recreates the implementation from PR flutter#172441 on a clean branch
after resolving rebase issues. Enables border radius when outer
border sides have uniform colors but different widths/styles.

Also adds inflateRRect and deflateRRect methods to EdgeInsets
for consistent handling of rounded rectangles.

Piinks pushed a commit to korca0220/flutter that referenced this pull request

Sep 22, 2025

github-merge-queue bot pushed a commit that referenced this pull request

Sep 24, 2025
Re-implementation of PR #172441

<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

## Add non-uniform border radius support to TableBorder
This PR extends TableBorder to support border radius even when the outer
border sides have different widths but the same color, similar to the
non-uniform border support added to Border in #121921.

### Changes
- Enhanced border rendering logic: TableBorder can now apply border
radius when outer border sides have uniform colors but non-uniform
widths/styles
- New helper methods: Added `outerBorderIsUniform` property and
`distinctVisibleOuterColors()` method to determine border uniformity
- Optimized paint method: Refactored the paint logic to handle three
scenarios:
  1. Fully uniform borders (existing optimized path)
2. Outer borders with uniform colors but non-uniform widths (new
non-uniform border radius support)
3. Completely non-uniform borders (fallback to standard border painting)

### Before/After
- Before: TableBorder with border radius required all sides (including
inner borders) to be completely identical.
- After: TableBorder with border radius only requires outer border
colors to be the same, allowing different widths per side.

### Example Usage
```dart
TableBorder(
  top: BorderSide(color: Colors.blue, width: 3.0),
  right: BorderSide(color: Colors.blue, width: 1.0),  // Different width
  bottom: BorderSide(color: Colors.blue, width: 2.0), // Different width  
  left: BorderSide.none,                              // No border
  horizontalInside: BorderSide(color: Colors.red, width: 1.0), // Different color OK
  verticalInside: BorderSide(color: Colors.red, width: 1.0),   // Different color OK
  borderRadius: BorderRadius.circular(8), // ✅ Now works!
)
```
Fixes: #173193


## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

Jaineel-Mamtora pushed a commit to Jaineel-Mamtora/flutter_forked that referenced this pull request

Sep 24, 2025
Re-implementation of PR flutter#172441

<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

## Add non-uniform border radius support to TableBorder
This PR extends TableBorder to support border radius even when the outer
border sides have different widths but the same color, similar to the
non-uniform border support added to Border in flutter#121921.

### Changes
- Enhanced border rendering logic: TableBorder can now apply border
radius when outer border sides have uniform colors but non-uniform
widths/styles
- New helper methods: Added `outerBorderIsUniform` property and
`distinctVisibleOuterColors()` method to determine border uniformity
- Optimized paint method: Refactored the paint logic to handle three
scenarios:
  1. Fully uniform borders (existing optimized path)
2. Outer borders with uniform colors but non-uniform widths (new
non-uniform border radius support)
3. Completely non-uniform borders (fallback to standard border painting)

### Before/After
- Before: TableBorder with border radius required all sides (including
inner borders) to be completely identical.
- After: TableBorder with border radius only requires outer border
colors to be the same, allowing different widths per side.

### Example Usage
```dart
TableBorder(
  top: BorderSide(color: Colors.blue, width: 3.0),
  right: BorderSide(color: Colors.blue, width: 1.0),  // Different width
  bottom: BorderSide(color: Colors.blue, width: 2.0), // Different width  
  left: BorderSide.none,                              // No border
  horizontalInside: BorderSide(color: Colors.red, width: 1.0), // Different color OK
  verticalInside: BorderSide(color: Colors.red, width: 1.0),   // Different color OK
  borderRadius: BorderRadius.circular(8), // ✅ Now works!
)
```
Fixes: flutter#173193


## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request

Dec 10, 2025
Re-implementation of PR flutter#172441

<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

## Add non-uniform border radius support to TableBorder
This PR extends TableBorder to support border radius even when the outer
border sides have different widths but the same color, similar to the
non-uniform border support added to Border in flutter#121921.

### Changes
- Enhanced border rendering logic: TableBorder can now apply border
radius when outer border sides have uniform colors but non-uniform
widths/styles
- New helper methods: Added `outerBorderIsUniform` property and
`distinctVisibleOuterColors()` method to determine border uniformity
- Optimized paint method: Refactored the paint logic to handle three
scenarios:
  1. Fully uniform borders (existing optimized path)
2. Outer borders with uniform colors but non-uniform widths (new
non-uniform border radius support)
3. Completely non-uniform borders (fallback to standard border painting)

### Before/After
- Before: TableBorder with border radius required all sides (including
inner borders) to be completely identical.
- After: TableBorder with border radius only requires outer border
colors to be the same, allowing different widths per side.

### Example Usage
```dart
TableBorder(
  top: BorderSide(color: Colors.blue, width: 3.0),
  right: BorderSide(color: Colors.blue, width: 1.0),  // Different width
  bottom: BorderSide(color: Colors.blue, width: 2.0), // Different width  
  left: BorderSide.none,                              // No border
  horizontalInside: BorderSide(color: Colors.red, width: 1.0), // Different color OK
  verticalInside: BorderSide(color: Colors.red, width: 1.0),   // Different color OK
  borderRadius: BorderRadius.circular(8), // ✅ Now works!
)
```
Fixes: flutter#173193


## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md