title: Flutter: What is the difference ButtonStyle() and .styleFrom()
body: <p>I am new in Flutter.</p>
  <p>Here is my code,</p>
  <p>For ElevatedButton,</p>
  <pre><code>ElevatedButton(
                    onPressed: () {
                      // Add your onPressed code here!
                    },
                    child: Text(&quot;Login&quot;),
                    style: ButtonStyle(
                        backgroundColor: MaterialStateProperty.all&lt;Color&gt;(
                            AppColors.SecondaryColor),
                        foregroundColor: MaterialStateProperty.all&lt;Color&gt;(
                            AppColors.PrimaryColor))),
  </code></pre>
  <p>For OutlinedButton,</p>
  <pre><code>OutlinedButton(
                    onPressed: () {
                      // Add your onPressed code here!
                    },
                    child: Text(&quot;Register Now&quot;),
                    style: OutlinedButton.styleFrom(
                      side: BorderSide(width: 2, color: AppColors.SecondaryColor),
                    ))
  </code></pre>
  <p>My question is why I must use <em>styleFrom</em> for <em>OutlinedButton</em> instead of <em>ButtonStyle</em>? if substitute <em>OutlinedButton.styleFrom</em> with <em>ButtonStyle</em>, it gives error. Why?</p>
  <p>I am very confuse with the usage of <em>ButtonStyle</em> and <em>styleFrom</em>. Because some of the example on the internet use <em>ButtonStyle</em> while some use <em>styleFrom</em>.</p>