I'm developing a FlutterFlow app. I made a custom function and edited it from a flutter environment. The custom function compares 2 Firebase document references in order to return true or false.
It works fine in the Flutter environment, but when I apply the code in the FlutterFlow project, this error message appears and I cant save the function:
The getter 'parentReference' isn't defined for the type 'PostulatesRecord'. Try importing the library that defines 'parentReference', correcting the name to the name of an existing getter, or defining a getter or field named 'parentReference'.
This is the custom function:
bool newCustomFunction(
TravelsRecord travelPostulate,
List<PostulatesRecord> visibilityPostulate,
) {
bool visible = false;
visibilityPostulate.forEach((element) {
if (element.parentReference.id == travelPostulate.reference.id) {
visible = true;
}
});
return visible;
}