Color

>(

Set

MaterialState

states

if

states

contains

MaterialState

disabled

))

return

Colors

blue

return

null

// Defer to the widget's default.

}),

),

onPressed:

null

child:

Text

'ElevatedButton with custom disabled colors'

),

As with the previous case, there are obvious ways to make the new
version more compact in an app where this migration comes up often.

Migrating buttons with custom elevations