Loop Action references the object instead of data structure field

Troubleshooting

Hi,

I am very excited about the new Loop action improvement to iterate over lists instead of using the while condition and having to abuse a page or app state variable.

However, I've come across (as I think) a bug: When I reference the "Current Item of Loop 1 action", in the visual editor I can directly access the data fields, e.g., a productName field (see screenshot attached).

However, the generated code assigns the actual object rather than the object's property, leading to an error on the dart code level (also screenshot attached)

Reproduce:

1) Create a FF project

2) Create a Data type ("Product") with one field or more fields

3) Create an SQLite DB and define a query and the output fields.

4) Add a page state that holds a List<Product>

5) Add a ListView using the List<Product> to render the children dynamically

6) Add a button with this action sequence:

a) Backend Call SQLite with query

b) Insert LoopAction to iterate over the SQL result

c) Try to add a new Product object to the List<Product> by using the "create datatype" functionality and reference the respective fields in the SQLite resultset

7) Try to run, and you'll get an error stating "Error (Xcode): lib/pages/home_page/home_page_widget.dart:121:36: Error: The argument type 'TestQueryRow' can't be assigned to the parameter type 'int?'."

I've attached a few screens, and believe it is a bug. It can be circumvented by using a page state variable to store the object in.

I am also happy to share a project to reproduce.

Would be lovely if somebody could fix it.

What have you tried so far?

Different scenarios, all leading to the same result.

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