DataTable dynamic value from component!

Actions & Logic

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/

What have you tried so far?

I tried adding an int argument "quantity" and added to the loop item.quantidade += quantidade, then I add the return value with an app State, but I get a compilation error saying that flutterflow can't find my setter.

I tried using the Unique Key, but also without success. I am out of ideas.

Did you check FlutterFlow's Documentation for this topic?
Yes
1 reply