Repository navigation
[Cupertino] Default primaryContrastingColor is incorrect in dark mode #152846
Copy link
Copy link
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: fidelityMatching the OEM platforms betterMatching the OEM platforms betterfound in release: 3.22Found to occur in 3.22Found to occur in 3.22found in release: 3.24Found to occur in 3.24Found to occur in 3.24frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: cupertino_uicupertino_ui package in flutter/packagescupertino_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Description
Steps to reproduce
- Create a
CupertinoAppwithout overriding the theme - Inside of it create a
CupertinoButtonthat displays some text, again without overriding any themes or colors
Expected results
The default primaryContrastColor should be CupertinoColors.white, which always resolves to white regardless of platform brightness
Actual results
The default primaryContrastColor is CupertinoColors.systemBackground, which resolves to black(-ish) in dark mode, which is incorrect.
Code sample
Code sample
import 'package:flutter/cupertino.dart';
void main() =>
runApp(
CupertinoApp(
home: Center(
child: CupertinoButton.filled(
onPressed: () {},
child: Text("Text"),
)
)
),
);
Screenshots or Video
Logs
No response
Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.22.2, on macOS 14.4.1 23E224 darwin-arm64, locale en-US)
• Flutter version 3.22.2 on channel stable
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 761747bfc5 (9 weeks ago), 2024-06-05 22:15:13 +0200
• Engine revision edd8546116
• Dart version 3.4.3
• DevTools version 2.34.3
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[!] Xcode - develop for iOS and macOS (Xcode 15.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15F31d
✗ Unable to get list of installed Simulator runtimes.
• CocoaPods version 1.14.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
[✓] VS Code (version 1.91.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.94.0
[✓] Connected device (4 available)
[✓] Network resources
• All expected network resources are available.
! Doctor found issues in 3 categories.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: fidelityMatching the OEM platforms betterMatching the OEM platforms betterfound in release: 3.22Found to occur in 3.22Found to occur in 3.22found in release: 3.24Found to occur in 3.24Found to occur in 3.24frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: cupertino_uicupertino_ui package in flutter/packagescupertino_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team

Activity
danagbemava-nc commentedon Aug 5, 2024
Reproducible using the code sample provided above.
flutter doctor -v
kerberjg commentedon Aug 7, 2024
I've also investigated the possibility of using iOS' UIColor
lightText, but that didn't seem to look correct either (screenshot below).I'd like to confirm that the default
primaryContrastingColorisCupertinoColors.white. I'll submit a PR fixing thatSets default Cupertino `primaryContrastingColor` to white
kerberjg commentedon Aug 7, 2024
PR has been submitted, pending review
Sets default Cupertino `primaryContrastingColor` to white
Set default Cupertino `primaryContrastingColor` to white (#153039)
Implemented CupertinoButton new styles/sizes (fixes #92525) (#152845)
Set default Cupertino `primaryContrastingColor` to white (flutter#153039
Implemented CupertinoButton new styles/sizes (fixes flutter#92525) (f…
github-actions commentedon Aug 23, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.Set default Cupertino `primaryContrastingColor` to white (flutter#153039