-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
RaisedButton's text is invisible in AlertDialog #30047
Comments
I would suggest that the A naive solution (commented out Color getTextColor(MaterialButton button) {
if (!button.enabled)
return getDisabledTextColor(button);
if (button.textColor != null)
return button.textColor;
switch (getTextTheme(button)) {
case ButtonTextTheme.normal:
return getBrightness(button) == Brightness.dark ? Colors.white : Colors.black87;
case ButtonTextTheme.accent:
// return colorScheme.secondary;
case ButtonTextTheme.primary: {
final Color fillColor = getFillColor(button);
final bool fillIsDark = fillColor != null
? ThemeData.estimateBrightnessForColor(fillColor) == Brightness.dark
: getBrightness(button) == Brightness.dark;
if (fillIsDark)
return Colors.white;
if (button is FlatButton || button is OutlineButton)
return colorScheme.primary;
return Colors.black;
}
}
assert(false);
return null;
} EDIT: The text of |
Hi @jul1u5 `flutter doctor -v`
if you disagree please write in the comments and I will reopen it |
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 version: latest stable (v1.2.1)
The issue occurs when trying to use
RaisedButton
inAlertDialog
actions. The background color of the button and the text color are the same, and thus the text is not visible. Of course, it's possible to manually change thetextTheme
ortextColor
of the particular button, but that's undesirable, the default shouldn't be unusable.Might be related to #22789
Steps to Reproduce
I believe the background color of the button is correct, but the text color should be white.
The issue can also be reproduced with the
ButtonTheme.bar
constructor, whichAlertDialog
uses to wrap actions. Even simpler example:Perhaps
RaisedButton
should behave differently withButtonTextTheme.accent
.The text was updated successfully, but these errors were encountered: