I have been working with radio button ; don’t seem to figure out how to make the icon appear and disappear up on selection.
2
You might want to look at Widgets like Chip and RawChip. RawChip on flutter.dev
There you can set the selected option to true and you get a checkmark.
To create more chips and make them selectable in Flutter, you can use the Chip widget and wrap it inside a ChoiceChip or FilterChip widget. Here’s an example:
List<String> _options = ['Option 1', 'Option 2', 'Option 3']; List<String> _selectedOptions = []; Widget build(BuildContext context) { return Wrap( children: _options.map((option) { return ChoiceChip( label: Text(option), selected: _selectedOptions.contains(option), onSelected: (selected) { setState(() { if (selected) { _selectedOptions.add(option); } else { _selectedOptions.remove(option); } }); }, ); }).toList(), ); }
Click here to cancel reply.
2
Answers
You might want to look at Widgets like Chip and RawChip.
RawChip on flutter.dev
There you can set the selected option to true and you get a checkmark.
To create more chips and make them selectable in Flutter, you can use the Chip widget and wrap it inside a ChoiceChip or FilterChip widget. Here’s an example: