Action not triggered when DateTime input changes in custom component؟

Actions & Logic

Hello everyone,

I have a custom component where an action is executed in the initState method. This action returns a string, which is displayed in a Text widget. The component also takes a DateTime input, which is used in this action.

The component is used inside a page. The issue I'm facing is that when the DateTime input of the component changes in the page, the action inside the component does not re-execute, and the output string remains unchanged.

I've already enabled the "Update Page on Change" checkbox, but the problem persists.

Is there a solution to ensure the action is re-triggered whenever the DateTime input changes?

Thanks for your help!

What have you tried so far?

So far, I’ve tried enabling the "Update Page on Change" option, assuming it would refresh the component when the DateTime input changes, but that didn’t solve the problem.

I’ve tried using the DateTime input directly within the action inside the component, but the action still doesn’t re-execute when the input changes.

I also attempted to store the input DateTime in a local variable inside the component, then used that variable in the action. However, even with this approach, the action is only triggered once during initialization and doesn’t update when the DateTime input changes.

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