onPress method

dynamic onPress(
  1. List<VehicleCard> vehicleList,
  2. int index
)

Implementation

onPress(List<VehicleCard> vehicleList, int index) {
  for (var element in vehicleList) {
    element.isSelected = false;
  }
  vehicleList[index].isSelected = true;

  notifyListeners();
}