select method
"When the user taps the button, set the selected state to true."
The setState() function is the key to making the button interactive. It tells Flutter to rebuild the widget tree, which causes the framework to update the display
Implementation
void select() => setState(() {
selected = true;
});