title: How can I change the background color of a textbutton in flutter?
body: <p>I'm trying to migrate my <code>FlatButton</code> to <code>TextButton</code>. Since <code>FlatButtons</code> are deprecated since I upgraded my flutter version. I'm currently struggling with adapting the background color.</p>
  <p>Old button:</p>
  <pre><code>FlatButton(
          height: height,
          onPressed: onPressed,
          shape: baseButtonBorder,
          color: Colors.red,
          child: Text(label, style: TextStyle(color: fontColor, fontWeight: boldLabel ? FontWeight.bold : FontWeight.normal)),
        )`
  </code></pre>
  <p>New Button:</p>
  <pre><code>TextButton(
          onPressed: onPressed,
          style: ButtonStyle(backgroundColor: Colors.red), // &lt;-- Does not work
          child: Text(label, style: TextStyle(color: fontColor, fontWeight: boldLabel ? FontWeight.bold : FontWeight.normal)),
        ),
  </code></pre>
  <p>The flat button does not have a <code>color</code> attribute so I tried to use the <code>style</code> attribute and add a <code>ButtonStyle</code>. How ever dart says:</p>
  <p><code>The argument type 'MaterialColor' can't be assigned to the parameter type 'MaterialStateProperty&lt;Color&gt;'.</code></p>
  <p>How can I style my <code>TextButton</code> with the color red like I used to do with my <code>FlatButton</code>? Do I need to create a <code>MaterialStateProperty&lt;Color&gt;</code> with red?</p>