title: How to make a save changes button?
body: <p>I have an AlertDialog that I use as a settings window, when the user opens it, the Apply button is not active, I would like that when the settings change, the button becomes active and saves the changes. How can I do this?</p>
  <p>showAlertDialogSettings(BuildContext context, state) {</p>
  <pre><code> Widget okButton = TextButton(
      child: Text(&quot;Apply&quot;), 
      onPressed:  null, 
    );
    
    Widget cancelButton = TextButton(
      child: Text(&quot;Close&quot;),
      onPressed:() =&gt; Navigator.pop(context),
    );
  
    AlertDialog alert = AlertDialog(
  
      title: Center(child: Text(&quot;Settings&quot;)),
      content:  Column(
            mainAxisSize: MainAxisSize.min,
        children: [
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
            Text('Sound:'),
            SwitchWidget(),
          ],),
          SizedBox(
            height: 48,
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
              Text('Difficulty:'),
              Padding(
                padding: const EdgeInsets.only(right: 5),
                child: DropDownButtonSettingsWidget()
              ),
            ],),
          ),  
        ],
      ),
    
      actions: [
        okButton,
        cancelButton,
  
      ],
    );
  
    showDialog(
      context: context,
      builder: (BuildContext context) {
        return BackdropFilter (  
        filter: ImageFilter.blur(sigmaX: 6, sigmaY: 6), 
        child: alert );
      },
    );
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/HYCk7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HYCk7.png" alt="enter image description here" /></a></p>