Migrating buttons with custom disabled colors

By default, all of the buttons use the color scheme’s onSurface color,
with opacity 0.38 for the disabled foreground color. Only
ElevatedButton has a non-transparent background color and its default
value is the onSurface color with opacity 0.12. So in many cases one
can just use the styleFrom method to override the disabled colors:

RaisedButton

disabledColor:

Colors

red

withOpacity

0.12

),

disabledTextColor:

Colors

red

withOpacity

0.38

),

onPressed:

null

child:

Text

'RaisedButton with custom disabled colors'

),