-
Notifications
You must be signed in to change notification settings - Fork 26.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cupertino in dark mode is too low-contrast and theme APIs are missing #80860
Comments
EDIT 2: Updated to use a copy of |
I still need this. |
EDIT3: Change title and section headings to clearly state that this is a problem with the widget implementations, Flutter API, and missing documentation. Cupertino dark mode support is incomplete. |
Very much support this, given iOS support for light and dark mode is no longer very new, Flutter should properly support iOS. Looking for feature parity between 'MaterialApp' and 'CupertinoApp' as well as the theme classes. |
Hoping this gets some attention. Would be very nice to have the same depth in CupertinoThemeData as we do in ThemeData. |
Same, would like to have this in Flutter |
@kevin-hv I've just resorted to forcing our app to light mode via the brightness:
Obviously not ideal, but saved me a ton of conditional logic and workarounds for the lack of Cupertino theme support. |
@mleonhard Could we split this up into smaller subtasks and make this issue an umbrella issue? I'd like to work on getting some of the things listed working if I can. (the first step would be to have a |
This issue is very unlikely to get resolved in its current state because it is an umbrella issue and therefore diffuses responsibility. I recommend that people interested in seeing this resolved file distinct issues for each thing that needs to change, and then link to them from here. |
Adjusted title and labels because in general we fix bugs rather than document workarounds for them: In particular, all of the items under "Problems in Dark Mode" appear to be that something is too dark or too light. It's hard to evaluate without screenshots of iOS native widgets to compare to; but for one item (the alert dialog), #80921 makes clear that indeed the problem is too dark a dialog background causing too little contrast with the overall background. (The next step remains, as @Hixie said above, for someone who wants to make progress on one or more of these issues to file them as separate issue threads.) |
Use case
I'm writing an app with iOS style using Flutter's Cupertino library. I want the app to automatically switch between light and dark modes.
Proposal
Existing APIs with Missing or Undocumented Dark Mode Support
MaterialApp
constructor takes boththeme
anddarkTheme
arguments. TheCupertinoApp
constructor takes onlytheme
.CupertinoTheme
takes a singleCupertinoThemeData
which can represent either a light or a dark color scheme, but not both.Theme
andThemeData
have the same limitation.CupertinoDynamicColor
seems able to choose specific colors for light and dark modes. The docs are very difficult to understand. For example, it talks about "manually resolving a color" but I have no idea what this means.MediaQuery.of(ctx).platformBrightness
to pick the theme passed toCupertinoApp
because there is no parentMediaQuery
widget. Sadly, one cannot just add a newMediaQuery
widget above theCupertinoApp
widget because the code to query the system's settings is hidden inwidgets/app.dart:_MediaQueryFromWindow
.Mostly-Working Example
Problems in Dark Mode:
code sample
EDIT 1: Mention
MediaQuery.of(ctx).platformBrightness
.The text was updated successfully, but these errors were encountered: