Generates incorrect Dart references for action outputs used in callback flows #5751
Open
1 task done
Labels
status: can't reproduce
Following the reported steps did not reproduce the bug.
Can we access your project?
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,productInfo
(a properly defined component state variable) is used for everything else.Steps to Reproduce
productId
(string).productId
parameter.readProductInfoSelect
.productInfo
) toreadProductInfoSelect
.Bug Report Code (Required)
IT4glcmAuItIrt9G7aX6bu9VqycUOUw/UK00sd4bGA0dCJzuPLMQdvWlRxNvONfmYGxpfUSmmTgJzNr9kYSeNPE7EzKVUYhd+qoBTRaWWnyVQZOBDaisZkElQZhgIWKZ0563oRNNJft0SnAG1HGINe6iYB7DHpjxIlFISq/LZO4=
Visual documentation
Environment
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.
The text was updated successfully, but these errors were encountered: