I have a list which has select option:
GestureDetector(
onTap: () {
toggleIndexDay(sunIndex);
confirmed = true;
},
child: Card(
and toggle instance:
void toggleIndexDay(int i) {
if (selectionDayIndexes.contains(i))
setState(() => selectionDayIndexes.remove(i));
else
setState(() => selectionDayIndexes.add(i));
}
this allow me to select and unselect element in the list.
Now I have another instance called ConfirmSelection
which Allow me to display a confirmation Button, but I dont know how to hide if in the List there is nothing Selected.
to display the button this is my code:
bool confirmed = false;
action on the button above with confirmed = true;
and in the widget:
floatingActionButton: (confirmed == true)
? FloatingActionButton( etc...
but how to hide if no item i the list is selected?