How to show dynamic text from a page state on the fly

Custom Code

I can't display the result of a function on the screen.
I have a database with items, and these items have prices.
I have a list view to display the shopping list and another list view to display the items already in the cart.
I have a toggle (purchased = true/false) to move items from one list to the other.

I want to display the total value of the items in the cart (purchased = true). I wrote a function that sums the items that pass through the filter and saves them in a Local State Page Variable.

What have you tried so far?

I'm having trouble creating a text widget to display the total of items in the purchased list.
I tried using a text widget pointing to the Local State Page Variable, but it doesn't update after the page loads.
I attempted to move the actions from Local Page State Variable's Onload to the toggle's actions, but it didn't work.
Also tried TextField with Set Form Field but no success.

I'm feeling so stupid right now.

Thanks in advance.

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