getDisabledFillColor method
The button
's background color when MaterialButton.onPressed is null
(when MaterialButton.enabled is false).
Returns the button's MaterialButton.disabledColor if it is non-null.
Otherwise the value of the disabledColor
constructor parameter
is returned, if it is non-null.
Otherwise the color scheme's ColorScheme.onSurface color is returned with its opacity set to 0.3 if getBrightness is dark, 0.38 otherwise.
Implementation
Color getDisabledFillColor(MaterialButton button) {
if (button.disabledColor != null)
return button.disabledColor;
if (_disabledColor != null)
return _disabledColor;
return _getDisabledColor(button);
}