I am having trouble with my dataTable. I have a list linked to it generated directly from my Firebase with a Query that I generate when I enter my page. In the table, I have some static items, but there is a specific item (Quantity) that is dynamic. I am using a component with a textField for this. How would I add this dynamic value to my selected row? I already have a Custom Function that I use to capture every item I selected, but I would like to dynamically add the quantity value to each selected row. I have been trying for 5 days in every possible way but I am out of ideas.
Could someone please help?
My custom code:
List<PlanilhaSebraeMGRecord> filterItem(
List<PlanilhaSebraeMGRecord> allItens,
List<int> selectedItemIndex,
) {
/// MODIFY CODE ONLY BELOW THIS LINE
List<PlanilhaSebraeMGRecord> selectedItem = [];
for (int i = 0; i < selectedItemIndex.length; i++) {
int index = selectedItemIndex[i];
if (index >= 0 && index < allItens.length) {
PlanilhaSebraeMGRecord item = allItens[index];
selectedItem.add(item);
}
}
return selectedItem;
/// MODIFY CODE ONLY ABOVE THIS LINE
}
Thx o/