Can we access your project?
Current Behavior
The typed SDK generator creates struct definitions with self-referencing fields that cause Dart's type inference to fail
with "circularity found during type inference" errors. These structs cannot be used in the DSL even though they work fine
in the FlutterFlow UI.
Actual Behavior
The generator creates structs with implicit typing that causes Dart's type inference to fail:
lib/flutterflow_project/schemas.dart:614:16: Error: Can't infer the type of 'event': circularity found during type
inference.
Specify the type explicitly.
static final event = ffai.StructHandle(
^^^^^
lib/flutterflow_project/schemas.dart:1169:16: Error: Can't infer the type of 'takeHomeLineItem': circularity found during
type inference.
Specify the type explicitly.
static final takeHomeLineItem = ffai.StructHandle(
Affected Structs
- takeHomeLineItem struct (schemas.dart:1169-1178)
static final takeHomeLineItem = ffai.StructHandle(
"TakeHomeLineItem",
<String, ffai.DslType>{
"amount": ffai.double_,
"breakdown": ffai.listOf(Structs.takeHomeLineItem), // ⚠️ Self-reference
"description": ffai.string,
// ... other fields
},
description: ffai.generatedProjectStructDescription,
);
Problem: The breakdown field references Structs.takeHomeLineItem before the takeHomeLineItem variable is fully
initialized, creating a circular dependency.
- event struct (schemas.dart:614+)
static final event = ffai.StructHandle(
"Event",
<String, ffai.DslType>{
// Contains fields that likely reference back to event or create circular dependency
// ...
},
description: ffai.generatedProjectStructDescription,
);
Expected Behavior
The typed SDK generator should handle recursive struct definitions by:
- Using explicit type annotations to break circularity
- Or restructuring the generated code to avoid type inference failures
- Allowing the struct to be used in DSL code
Steps to Reproduce
- Create a custom data type in FlutterFlow UI with a recursive field (e.g., a breakdown field that is a list of the same
type)
- Run flutterflow ai refresh-context to regenerate typed SDK
- Attempt to compile with flutterflow ai test or dart run dsl/edit.dart --dry-run
Reproducible from Blank
Bug Report Code (Required)
IT4WhfHl8YxgrsNA7rrtbcAwoDsvIjs9aIIzkMN+GAo3G5DvPLYPXPykP1doTcOiTFZYMFv8rGEx7vDIuNmeFOQHAzSBfIBT1LhbEhXKeGKnbLqVBoedPWpPP8ZNDkuV0raJmiQlOsB1dV4C312QFvCUcA3YJIT7PTISQ/L+DNn5s3eqAj+6Xn0Jg1ZSfCvr
Visual documentation
Components Affected
Two components try to use this struct (but with the wrong name):
- takeHomeLineItem component
- File: lib/flutterflow_project/components/take_home_line_item.dart
- Component key: Container_gck8pvoo
- Issue: Line 18 tries to use Structs.takeHomeValue (which doesn't exist, should be Structs.takeHomeLineItem)
- Double problem: Even if the name was correct, the struct itself won't compile due to circular reference
- taxLineItem component
- File: lib/flutterflow_project/components/tax_line_item.dart
- Component key: Container_oopeqngc
- Issue: Line 18 tries to use Structs.takeHomeValue (which doesn't exist, should be Structs.takeHomeLineItem)
- Double problem: Even if the name was correct, the struct itself won't compile due to circular reference
Why This Exists
This is a tree structure - each TakeHomeLineItem can have child items in its breakdown field, creating a hierarchical
breakdown of values. This is a legitimate and common data structure (like a file system or comment thread), but the typed
SDK generator doesn't handle the self-reference correctly.
In FlutterFlow UI: This works fine because the proto/backend handles recursive structures.
In local typed SDK: Fails because of Dart's type inference limitations with circular references.
Environment
- FlutterFlow AI SDK: Latest (as of 2026-06-16)
- Project ID: sell-side-side-kick-ok52jn
- Generated SDK location: lib/flutterflow_project/schemas.dart
Additional Information
Root Cause
Dart's type inference cannot resolve the type when:
- A variable is declared with final and type inference (no explicit type)
- The initializer references the variable being declared (directly or indirectly)
The generated code uses:
static final takeHomeLineItem = ffai.StructHandle(...) // ❌ Implicit type
When the map contains Structs.takeHomeLineItem, this creates circularity.
Suggested Fix
Option 1: Add explicit type annotation
static final ffai.StructHandle takeHomeLineItem = ffai.StructHandle(
"TakeHomeLineItem",
<String, ffai.DslType>{
"breakdown": ffai.listOf(Structs.takeHomeLineItem),
// ...
},
);
Option 2: Use late initialization
static late final takeHomeLineItem = ffai.StructHandle(
"TakeHomeLineItem",
<String, ffai.DslType>{
"breakdown": ffai.listOf(Structs.takeHomeLineItem),
// ...
},
);
Option 3: Two-phase initialization
// Phase 1: Declare all struct handles
static final takeHomeLineItem = ffai.StructHandle("TakeHomeLineItem", {});
// Phase 2: Wire up references (if StructHandle API supports mutation)
// ... set up fields including self-references
Can we access your project?
Current Behavior
The typed SDK generator creates struct definitions with self-referencing fields that cause Dart's type inference to fail
with "circularity found during type inference" errors. These structs cannot be used in the DSL even though they work fine
in the FlutterFlow UI.
Actual Behavior
The generator creates structs with implicit typing that causes Dart's type inference to fail:
lib/flutterflow_project/schemas.dart:614:16: Error: Can't infer the type of 'event': circularity found during type
inference.
Specify the type explicitly.
static final event = ffai.StructHandle(
^^^^^
lib/flutterflow_project/schemas.dart:1169:16: Error: Can't infer the type of 'takeHomeLineItem': circularity found during
type inference.
Specify the type explicitly.
static final takeHomeLineItem = ffai.StructHandle(
Affected Structs
static final takeHomeLineItem = ffai.StructHandle(
"TakeHomeLineItem",
<String, ffai.DslType>{
"amount": ffai.double_,
"breakdown": ffai.listOf(Structs.takeHomeLineItem), //
"description": ffai.string,
// ... other fields
},
description: ffai.generatedProjectStructDescription,
);
Problem: The breakdown field references Structs.takeHomeLineItem before the takeHomeLineItem variable is fully
initialized, creating a circular dependency.
static final event = ffai.StructHandle(
"Event",
<String, ffai.DslType>{
// Contains fields that likely reference back to event or create circular dependency
// ...
},
description: ffai.generatedProjectStructDescription,
);
Expected Behavior
The typed SDK generator should handle recursive struct definitions by:
Steps to Reproduce
type)
Reproducible from Blank
Bug Report Code (Required)
IT4WhfHl8YxgrsNA7rrtbcAwoDsvIjs9aIIzkMN+GAo3G5DvPLYPXPykP1doTcOiTFZYMFv8rGEx7vDIuNmeFOQHAzSBfIBT1LhbEhXKeGKnbLqVBoedPWpPP8ZNDkuV0raJmiQlOsB1dV4C312QFvCUcA3YJIT7PTISQ/L+DNn5s3eqAj+6Xn0Jg1ZSfCvr
Visual documentation
Components Affected
Two components try to use this struct (but with the wrong name):
Why This Exists
This is a tree structure - each TakeHomeLineItem can have child items in its breakdown field, creating a hierarchical
breakdown of values. This is a legitimate and common data structure (like a file system or comment thread), but the typed
SDK generator doesn't handle the self-reference correctly.
In FlutterFlow UI: This works fine because the proto/backend handles recursive structures.
In local typed SDK: Fails because of Dart's type inference limitations with circular references.
Environment
Additional Information
Root Cause
Dart's type inference cannot resolve the type when:
The generated code uses:
static final takeHomeLineItem = ffai.StructHandle(...) // ❌ Implicit type
When the map contains Structs.takeHomeLineItem, this creates circularity.
Suggested Fix
Option 1: Add explicit type annotation
static final ffai.StructHandle takeHomeLineItem = ffai.StructHandle(
"TakeHomeLineItem",
<String, ffai.DslType>{
"breakdown": ffai.listOf(Structs.takeHomeLineItem),
// ...
},
);
Option 2: Use late initialization
static late final takeHomeLineItem = ffai.StructHandle(
"TakeHomeLineItem",
<String, ffai.DslType>{
"breakdown": ffai.listOf(Structs.takeHomeLineItem),
// ...
},
);
Option 3: Two-phase initialization
// Phase 1: Declare all struct handles
static final takeHomeLineItem = ffai.StructHandle("TakeHomeLineItem", {});
// Phase 2: Wire up references (if StructHandle API supports mutation)
// ... set up fields including self-references