Repository navigation
Commit 68b3d02
authored
[cupertino_ui] Fix the tinted button's fill opacity (flutter#13436)
`CupertinoButton.tinted` fills with 12% of the accent where UIKit uses 18%. On white that is `#e0efff` against UIKit's `#d1e7ff`. Dark mode already matched at 26%.
Fixes flutter/flutter#195265
## The constant has a second reader
`kCupertinoButtonTintedOpacityLight` also paints `CupertinoActionSheetAction`'s focus highlight, so that changes as well.
That reuse was deliberate. The focus support PR (flutter/flutter#167119) took the colour from `CupertinoButton` on purpose, and iOS has no fixed number of its own here, because the focus colour is a system setting the user can change. Splitting the constant would pin the highlight to a value, whose only source was the button's.
## Tests
`button_test.dart` already pinned the light fill with a literal, so it just moves to 18%. `action_sheet_test.dart`'s light focus case computed its expected colour from the constant, so it could never fail on a value change and now carries the literal too. The dark cases still read the constant, which is correct, nothing here moves them.
## Not touched
The same line sits in `packages/flutter/lib/src/cupertino/constants.dart` with the same two readers, so `CupertinoButton.tinted` in the SDK keeps the old value.
## Pre-Review Checklist
[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.1 parent 8041cca commit 68b3d02
4 files changed
Lines changed: 6 additions & 3 deletions
File tree
- packages/cupertino_ui
- lib/src
- pending_changelogs
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2359 | 2359 | | |
2360 | 2360 | | |
2361 | 2361 | | |
2362 | | - | |
| 2362 | + | |
2363 | 2363 | | |
2364 | 2364 | | |
2365 | 2365 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
498 | 498 | | |
499 | 499 | | |
500 | 500 | | |
501 | | - | |
| 501 | + | |
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
| |||
0 commit comments