),

onPressed:

()

},

child:

Text

'TextButton'

),

This kind of override is common; however, in many cases what’s also
needed are overrides for the overlay colors that the text button uses
to indicate its hovered/focus/pressed state.  This can be done by
adding the overlayColor property to the ButtonStyle.

TextButton

style:

ButtonStyle

foregroundColor:

MaterialStateProperty

all

Color

>(

Colors

blue

),

overlayColor:

MaterialStateProperty

resolveWith

Color

>(

Set

MaterialState

states