title: How do I disable a Button in Flutter?
body: <p>I'm just starting to get the hang of Flutter, but I'm having trouble figuring out how to set the enabled state of a button.</p>
  
  <p>From the docs, it says to set <code>onPressed</code> to null to disable a button, and give it a value to enable it. This is fine if the button continues to be in the same state for the lifecycle.</p>
  
  <p>I get the impression I need to create a custom Stateful widget that will allow me to update the button's enabled state (or onPressed callback) somehow.</p>
  
  <p>So my question is how would I do that? This seems like a pretty straightforward requirement, but I can't find anything in the docs on how to do it.</p>
  
  <p>Thanks.</p>