Can we access your project?
Current Behavior
When a custom data type (struct) includes a field typed as a Firestore document reference, the generated Dart file references the corresponding record class (e.g. EventsRecord, ActivityRecord) but does not include the required import statement for it. This causes a compile error in any local Flutter build via the VS Code extension.
Example from know_d_t_struct.dart — EventsRecord is used throughout the file but the import is never emitted:
Error: Type 'EventsRecord' not found.
Three files affected in my project:
Generated file | Record class used | Missing import
-- | -- | --
structs/user_events_d_t_struct.dart | EventsRecord | import '/backend/schema/events_record.dart';
structs/know_d_t_struct.dart | EventsRecord | import '/backend/schema/events_record.dart';
structs/user_activity_d_t_struct.dart | ActivityRecord | import '/backend/schema/activity_record.dart';
Expected Behavior
The generated struct file should include an import for the Firestore record class it references, the same way that index.dart and other generated files include their dependencies. For example:
import '/flutter_flow/flutter_flow_util.dart';
import '/backend/schema/events_record.dart'; // ← this line should be generated
Steps to Reproduce
- Create a Firestore collection (e.g. events).
- Create a custom data type with a field whose type is set to a document from that collection.
- Download the generated code via the FlutterFlow VS Code extension.
- Attempt a local Flutter build (flutter run).
- Observe compile error: Type 'EventsRecord' not found in the generated struct file.
Note: deleting the local download folder and re-syncing produces the same result — the bug is in the generator, not the cached files.
Reproducible from Blank
Bug Report Code (Required)
IT4wi+fl4otItbxa15DuccdF9SkWCDs5RJ0vi8F+eCs8JJToPLAUZ8zBM05vZryrdH9UJVmWgmQd7PfqhuzlFccVEAqZY65GwZNITj3MQkKmRaXWPYe7fW1QTZ9QIHLC5rWruAl4Wep0WHwN3EOqHuStb3PYJrrUITIwRM+LKdeK2SrDX1iXc2URm05KZDPz
Visual documentation
Its not a visual issue
Environment
- FlutterFlow version: 6.6.121+
- Platform: Windows
- Browser name and version: Chrome (but using MCP, Claude Code and VS Code)
- Operating system and version affected: Windows 11
Additional Information
A patch script is required after every sync as a workaround:
// The generated file contains this usage:
EventsRecord? _eventRef;
EventsRecord? get eventRef => _eventRef;
// But the file header only has:
import 'package:cloud_firestore/cloud_firestore.dart';
import '/backend/schema/util/firestore_util.dart';
import '/backend/schema/util/schema_util.dart';
import '/backend/schema/enums/enums.dart';
import 'index.dart';
import '/flutter_flow/flutter_flow_util.dart';
// Missing: import '/backend/schema/events_record.dart';
Can we access your project?
Current Behavior
When a custom data type (struct) includes a field typed as a Firestore document reference, the generated Dart file references the corresponding record class (e.g.
EventsRecord,ActivityRecord) but does not include the required import statement for it. This causes a compile error in any local Flutter build via the VS Code extension.Example from
know_d_t_struct.dart—EventsRecordis used throughout the file but the import is never emitted:Three files affected in my project:
Generated file | Record class used | Missing import -- | -- | -- structs/user_events_d_t_struct.dart | EventsRecord | import '/backend/schema/events_record.dart'; structs/know_d_t_struct.dart | EventsRecord | import '/backend/schema/events_record.dart'; structs/user_activity_d_t_struct.dart | ActivityRecord | import '/backend/schema/activity_record.dart';Expected Behavior
The generated struct file should include an import for the Firestore record class it references, the same way that index.dart and other generated files include their dependencies. For example:
import '/flutter_flow/flutter_flow_util.dart';
import '/backend/schema/events_record.dart'; // ← this line should be generated
Steps to Reproduce
Note: deleting the local download folder and re-syncing produces the same result — the bug is in the generator, not the cached files.
Reproducible from Blank
Bug Report Code (Required)
IT4wi+fl4otItbxa15DuccdF9SkWCDs5RJ0vi8F+eCs8JJToPLAUZ8zBM05vZryrdH9UJVmWgmQd7PfqhuzlFccVEAqZY65GwZNITj3MQkKmRaXWPYe7fW1QTZ9QIHLC5rWruAl4Wep0WHwN3EOqHuStb3PYJrrUITIwRM+LKdeK2SrDX1iXc2URm05KZDPz
Visual documentation
Its not a visual issue
Environment
Additional Information
A patch script is required after every sync as a workaround:
// The generated file contains this usage:
EventsRecord? _eventRef;
EventsRecord? get eventRef => _eventRef;
// But the file header only has:
import 'package:cloud_firestore/cloud_firestore.dart';
import '/backend/schema/util/firestore_util.dart';
import '/backend/schema/util/schema_util.dart';
import '/backend/schema/enums/enums.dart';
import 'index.dart';
import '/flutter_flow/flutter_flow_util.dart';
// Missing: import '/backend/schema/events_record.dart';