onPressed:

()

},

child:

Text

'ElevatedButton with custom foreground/background'

),

In this case the button’s use of the color scheme’s primary color is
reversed relative to the TextButton: primary is button’s background
fill color and onPrimary is the foreground (text/icon) color.

Migrating buttons with custom overlay colors

FlatButton

focusColor:

Colors

red

hoverColor:

Colors

green

splashColor:

Colors

blue

onPressed:

()

},

child:

Text

'FlatButton with custom overlay colors'

),

TextButton