Updating Button's text value in a Component.

Actions & Logic
Resolved

Hello everyone,
in my App I have a Component A for product insertion. In this component you can click on a "choose category" button that leads you to another Component B where you can pick your product's category (or add a new one).

I want the text value of the Button in Component A to update with the category's name as soon as the user clicks on "select" button on Component B (which also closes the component).
The issue is it works, but the first time the AppState storing the Product info is updated (so the "category" field was empty before) the button's text doesn't refresh correctly and I have to click on the screen to update it.
From the 2nd time, meaning the "category" field in the AppState was not empty, it works as expected.

Below there is a video visually explaining the issue:
(red circle means I clicked with the mouse)

What have you tried so far?

I have tried changing the "Update AppState" action to "Rebuild current page" from "Rebuild current component", but the 2nd option doesn't work at all, as it rebuilds component B, which is useless as it is being closed right after the AppState update.

I think the issue comes from that "Has category Field" condition in the button's text value, as it seems like it doesn't update when the AppState's Category field is updated from Empty to a Value, but it does when the field is updated from a Value to another Value.
I already tried changing the condition to "Field is set/not empty", but the behaviour is the same.

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