Closed ueabu closed 5 years ago
I am currently trying to put a checkbox in the builder. The checkbox appears but does not respond when tapped. The value changes but the box itself does not change when the value changes. It remains to be the same color.
.... bool isChecked = false; AutoCompleteTextField<String>( suggestions: MySuggestion, itemSubmitted: (item) { setState(() => searchTextField.textField.controller.text = item); } itemBuilder: (context, item) { return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[ Text(item, style: TextStyle( fontSize: 16.0 ),), Padding( padding: EdgeInsets.all(15.0), ), Checkbox( value: isChecked, onChanged: (value) { setState(() { isChecked = value; }); print(isChecked); }, ), ], ); } )`
Does the builder for the suggestion use a different context?
Yeah probably, but I can't really know for sure without seeing the whole class.
Would you like to see the whole class ?
I am currently trying to put a checkbox in the builder. The checkbox appears but does not respond when tapped. The value changes but the box itself does not change when the value changes. It remains to be the same color.
Does the builder for the suggestion use a different context?