Currently have 7 GestureDetectors and Containers inside a SingleChildScrollView to represent a guitar neck and notes. Inside each container Gesture Detector, I add the item index to a list, and using this list I can cause an item to change color, indicating that it's been selected. Everything works fine right now, except the fact that I've got to refresh the application for my containers to update the selected items.
Here is my Gesture Detector and Container code
GestureDetector(
onTap: () {
if(selectedHighE.contains(index)){
selectedHighE.remove(index);
print("removed " + index.toString() + " from " + selectedHighE.toString());
}else{
selectedHighE.add(index);
print("added " + index.toString() + " to " + selectedHighE.toString());
};
},
child: Container(
width: 50,
height: 35,
alignment: Alignment.center,
decoration: BoxDecoration(
color: _change(hiENotes, index, selectedHighE),
border: Border.all(
color:
_borderColor(hiENotes, index))),
child: Text(hiENotes[index],
style: TextStyle(
color: _textColor(hiENotes, index),
fontSize: size))),
),
So, my intention is that the _change() will use the index of the current item, and the list of currently selected items, to determine if a container should be changed or not. However, as I've stated, the functionality is there I just need some method of refreshing the child Container after the onTap().
Thanks in advance