toggleButton method
Implementation
void toggleButton(Region region) {
if (region.id != widget.unSelectableId) {
setState(() {
if (selectedRegion.contains(region)) {
selectedRegion.remove(region);
} else {
if (widget.isMultiSelectable ?? false) {
selectedRegion.add(region);
} else {
selectedRegion.clear();
selectedRegion.add(region);
}
}
widget.onChanged.call(region);
});
}
}