Skip to content

[cupertino_ui] Fix the tinted button's fill opacity - #13436

Merged
auto-submit[bot] merged 3 commits into
flutter:mainfrom
LahaLuhem:bugfix/#195265-tinted-button-opacity
Nov 11, 2026
Merged

auto-submit[bot] merged 3 commits into
flutter:mainfrom
LahaLuhem:bugfix/#195265-tinted-button-opacity

Conversation

@LahaLuhem

@LahaLuhem LahaLuhem commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

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

Footnotes

  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. ↩ ↩2

@github-actions github-actions Bot added p: cupertino_ui triage-design Should be looked at in design triage labels Oct 26, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the kCupertinoButtonTintedOpacityLight constant from 0.12 to 0.18 to align with iOS design guidelines, along with updating related tests and adding a changelog entry. Feedback on the changes suggests splitting the multi-variable declaration in constants.dart into separate lines to adhere to the Effective Dart style guide.

@LahaLuhem
LahaLuhem force-pushed the bugfix/#195265-tinted-button-opacity branch 2 times, most recently from 25a00a9 to 8adc479 Compare October 27, 2026 07:55
@elliette
elliette requested a review from dkwingsmt October 27, 2026 21:17
@LahaLuhem
LahaLuhem force-pushed the bugfix/#195265-tinted-button-opacity branch 2 times, most recently from 88927f7 to 1d4aa01 Compare November 7, 2026 10:58
@LahaLuhem
LahaLuhem force-pushed the bugfix/#195265-tinted-button-opacity branch from 1d4aa01 to 3c40a47 Compare November 8, 2026 10:06
@LahaLuhem

LahaLuhem commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor Author

@dkwingsmt

Native, UIKit .tinted()
#d1e7ff
UIKit tinted button
Native, SwiftUI .bordered
#d1e7ff
SwiftUI bordered button
Before, main
#e0efff
CupertinoButton.tinted on main
After, this PR
#d1e7ff
CupertinoButton.tinted on this PR

All on iPhone 16 Pro, iOS 18.5.

@dkwingsmt dkwingsmt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

@dkwingsmt
dkwingsmt requested a review from pjkammer November 10, 2026 21:56
@LahaLuhem

LahaLuhem commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor Author

Looking at the screenshots, I also noticed the sizes discrepency. I've filed #196373

@pjkammer pjkammer added the CICD Run CI/CD label Nov 11, 2026
@pjkammer pjkammer added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 11, 2026
@auto-submit
auto-submit Bot merged commit 68b3d02 into flutter:main Nov 11, 2026
15 checks passed
b-luk pushed a commit to b-luk/flutter that referenced this pull request Nov 12, 2026
…r#196450)

flutter/packages@653628e...14f9933

2026-11-12 [email protected] [material_ui]
Fix SnackBarThemeData.lerp dropping showCloseIcon
(flutter/packages#13449)
2026-11-11 [email protected] [ci] Update repo
for 3.50 stable release (flutter/packages#13628)
2026-11-11 [email protected] [vector_graphics]
Use font-family lists as a family with fallbacks
(flutter/packages#13552)
2026-11-11 [email protected] Roll Flutter (stable) from
c197ca5 to ab29120 (1647 revisions) (flutter/packages#13625)
2026-11-11 [email protected] [shared_prferences] Adopts
mockito-kotlin in tests (flutter/packages#13624)
2026-11-11 [email protected] [cupertino_ui] Dim disabled
CupertinoSlider controls (flutter/packages#13419)
2026-11-11 [email protected] [flutter_svg] Invalidate pending cache
entries on clear and evict (flutter/packages#13595)
2026-11-11 [email protected] [cupertino_ui] Fix the tinted
button's fill opacity (flutter/packages#13436)
2026-11-11 [email protected] [various]
Support SVG filters (blur, offset, feMerge) (flutter/packages#11909)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD p: cupertino_ui triage-design Should be looked at in design triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[cupertino_ui] CupertinoButton.tinted fills with 12% of the accent, not UIKit's 18%

3 participants