Skip to content

Generated schemas.dart shadows the key field with the [] operator's parameter — uncompilable for any Supabase table with a Key column #7412

Description

@Altranovo

Can we access your project?

  • I give permission for members of the FlutterFlow team to access and test my project for the sole purpose of investigating this issue.

Current Behavior

flutterflow ai init and refresh-context generate lib/flutterflow_project/schemas.dart. For a Supabase table with a column named Key, the generated [] operator returns its own parameter instead of the field.

At line 1258 of 7313:

ffai.PostgresTableField? operator [](Object? key) => switch (key) {
      "Key" => key,          // returns the PARAMETER, not the field
      "Language" => language,
      ...

The class has a field key (generated for the Key column) and the operator takes a parameter also named key. The parameter shadows the field, so the "Key" arm returns the Object? parameter:

Error: A value of type 'Object?' can't be returned from a function with return type 'PostgresTableField?'.

The typed project SDK therefore does not compile at all. Every flutterflow ai validate and every flutterflow ai run fails before reaching the user's DSL, regardless of whether that work touches the affected table. There is no error message pointing at the real cause — the failure presents as a problem with the user's own script.

Local workaround, which must be re-applied after every regeneration:

"Key" => this.key,

It is the only occurrence in the file.

Expected Behavior

The generated code should compile. Either qualify generated field references with this., or rename the operator's parameter to something that cannot collide with a column-derived field name (for example fieldName).

This presumably affects any column whose name collides with the generated parameter, not only Key.

Steps to Reproduce

  1. Connect a Supabase project containing a table with a column named Key (ours is the table app_content).
  2. Run flutterflow ai init (or flutterflow ai refresh-context <project-id>) to generate the typed project SDK.
  3. Open lib/flutterflow_project/schemas.dart and find the generated [] operator for that table. Observe the arm "Key" => key, — the parameter, not the field.
  4. Run any command that compiles the typed SDK, e.g.:
    flutterflow ai validate
  5. Observe the failure:
    Error: A value of type 'Object?' can't be returned from a function with return type 'PostgresTableField?'.
  6. Change that single line to "Key" => this.key, and re-run step 4. It now succeeds — confirming the shadowing is the whole cause.

Reproducible from Blank

  • The steps to reproduce above start from a blank project.

Bug Report Code (Required)

ITEelsn1z4pNj7xH1brUd8JFqwMwGkQ5a7sviu5+FBQaI+PvE+wxPuOlXFdvWOqHTXNiMFKajmAG+fTOivPpJ/BfHASZb7Vy1alpUxDjUk66aJSWDpewQmpAM8FRFX6+37ukkCN4XcZsdFpg3UOIHPOQa3qCf9qOYwx5e6fDbOY=

Visual documentation

Image

Environment

- FlutterFlow v7.0.72 (released August 19, 2026), Flutter 3.38.6
- FlutterFlow AI CLI (`flutterflow`), run from Terminal.app on macOS
- Project: blank-phighh ("Altranovo"), Supabase backend
- Affected table: app_content, column `Key`
- File: lib/flutterflow_project/schemas.dart, line 1258 of 7313

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs triageA potential issue that has not been confirmed as a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions