Hello FlutterFlow Community & Support Team,
I'm encountering a critical and persistent issue with custom functions in my project that is severely blocking development. I've tried extensive troubleshooting, but the problem persists.
The Problem:
When creating or saving any custom function (e.g., createDocumentReference, formatLatLng, as a function), I consistently receive the error message:
"The function is empty or cannot be parsed. Make sure not to modify code outside of the designated area."
This error occurs even with minimal, correct Dart code, and prevents the custom function from being saved or compiled.
(code below)
import 'package:cloud_firestore/cloud_firestore.dart';
DocumentReference createDocumentReference(
String collectionPath,
String documentId,
) {
return FirebaseFirestore.instance.collection(collectionPath).doc(documentId);
}
(This function is supposed to return a DocumentReference from a String ID, with Return Type DocumentReference, Document Type gates, and String arguments collectionPath and documentId).