blue

onSurface:

Colors

red

),

onPressed:

null

child:

Text

'TextButton'

),

Using the styleFrom() method is the preferred way to create a
ButtonStyle if you’re trying to create a Material Design
variation. The most flexible approach is defining a ButtonStyle
directly, with MaterialStateProperty values for the states whose
appearance you want to override.

ButtonStyle defaults

Migration guide

Use the following information to migrate your buttons to the
new API.

Restoring the original button visuals

In many cases it’s possible to just switch from the old button class
to the new one.  That’s assuming that the small changes in size/shape
and the likely bigger change in colors, aren’t a concern.