mardi 29 septembre 2020

Unable to uncheck the check Box

I am using CheckboxListTile in for check box. It works good if selected : false. If selected is true then unable to un check it.

final checkBox = CheckboxListTile(
      contentPadding: EdgeInsets.all(0),
      title: Text("Remember Me", style: TextStyle(fontSize: 15.0)),
      selected: checkBoxState,
      value: checkBoxState,
      checkColor: Colors.white,
      activeColor: Colors.grey,
      controlAffinity: ListTileControlAffinity.leading,
      onChanged: (newValue) {
        setState(() {
          checkBoxState = newValue;
        });
      },
    );

This is the code what I am using.

Thanks in Advance,




Aucun commentaire:

Enregistrer un commentaire