Skip to content

Generates incorrect Dart references for action outputs used in callback flows #5751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
fiveminutejob opened this issue Apr 26, 2025 · 1 comment
Open
1 task done
Assignees
Labels
status: can't reproduce Following the reported steps did not reproduce the bug.

Comments

@fiveminutejob
Copy link

fiveminutejob commented Apr 26, 2025

Can we access your project?

  • I give permission for members of the FlutterFlow team to access and test my project for the sole purpose of investigating this issue.

Current Behavior

When using an action output (e.g. a Firestore "Get Document" result) inside a*callback flow, FlutterFlow generates Dart code that incorrectly assumes the action output is a page state variable. This leads to build errors even when the action output is used only within its own callback flow.

The generated Dart code tries to reference readProductInfoSelect in _model, even though it was never declared as a component state variable. This results in a build error:

Error: The getter/setter 'readProductInfoSelect' isn't defined for the class 'AddPOOrderItemModel'. (parent widget)

Expected Behavior

The project should build successfully, since:

  • readProductInfoSelect is only used within the action flow,
  • and productInfo (a properly defined component state variable) is used for everything else.

Steps to Reproduce

  1. In a parent widget, create a custom component with a button to open a child component (e.g. Select Product).
  2. From the child component, trigger a callback, passing back a productId (string).
  3. In the callback handler (in the parent):
    • Run a Firestore Get Document action using the productId parameter.
    • Set the output variable name to something like readProductInfoSelect.
    • Add a Set State action immediately after, setting a defined state field (e.g. productInfo) to readProductInfoSelect.
  4. Run the project.

Bug Report Code (Required)

IT4glcmAuItIrt9G7aX6bu9VqycUOUw/UK00sd4bGA0dCJzuPLMQdvWlRxNvONfmYGxpfUSmmTgJzNr9kYSeNPE7EzKVUYhd+qoBTRaWWnyVQZOBDaisZkElQZhgIWKZ0563oRNNJft0SnAG1HGINe6iYB7DHpjxIlFISq/LZO4=

Visual documentation

Image

Environment

- FlutterFlow version: Latest
- Platform: Desktop
- Browser name and version: Chrome Latest
- Operating system and version affected:  Win 11 Pro 26100.3775

Additional Information

Renaming the action output does not resolve the issue. This appears to be a mismatch between FlutterFlow’s expected code generation and Dart’s actual compiled structure.

It seems FlutterFlow is generating _model.readProductInfoSelect in the Dart model class even though:

The output is not used as a component state field,
and is never accessed outside its action flow.

This could be fixed by:

Preventing FlutterFlow from referencing outputs in _model unless explicitly added to component state, or
Automatically scoping action outputs correctly inside action flows.

@fiveminutejob fiveminutejob added the status: needs triage A potential issue that has not been confirmed as a bug. label Apr 26, 2025
@fiveminutejob fiveminutejob changed the title lutterFlow generates incorrect Dart references for action outputs used in callback flows labels: bug Generates incorrect Dart references for action outputs used in callback flows Apr 28, 2025
@Alezanello Alezanello self-assigned this Apr 28, 2025
Copy link
Collaborator

Hello!

Thanks for reaching out. I wasn’t able to replicate the issue on my end — it’s possible I might be missing a specific step.

To help us move forward, I’ve created a public project that you can clone. Feel free to make any necessary changes to it so you can demonstrate the exact steps to replicate the issue you’re encountering.
So far, I'm able to retrieve the document from the callback without any problems.

Here’s the link to the project: https://app.flutterflow.io/project/qa-4044-k09mg2

image.png

@Alezanello Alezanello removed the status: needs triage A potential issue that has not been confirmed as a bug. label Apr 28, 2025
@Alezanello Alezanello added the status: can't reproduce Following the reported steps did not reproduce the bug. label Apr 28, 2025 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: can't reproduce Following the reported steps did not reproduce the bug.
Projects
None yet
Development

No branches or pull requests

2 participants