Migrating a RaisedButton with custom foreground and background colors:

RaisedButton

color:

Colors

red

// background

textColor:

Colors

white

// foreground

onPressed:

()

},

child:

Text

'RaisedButton with custom foreground/background'

),

ElevatedButton

style:

ElevatedButton

styleFrom

primary:

Colors

red

// background

onPrimary:

Colors

white

// foreground

),

onPressed:

()

},