Skip to content

Design from FlutterFlow Designer fails to build #7101

@paresy

Description

@paresy

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

You seem to use "context" inside the constructor and it is not properly defined at this point. Therefore the build fails to compile with the following error:

56 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
Launching lib/main.dart on Web Server in debug mode...
Waiting for connection from debug service on Web Server...      
lib/components/text_field_widget.dart:13:478: Error: Undefined name 'context'.
  const TextFieldWidget({super.key , bool?label,bool?helper,String?hint,String?value,this.leading_icon,bool?leading_icon_present,this.trailing_icon,bool?trailing_icon_present,Color?bg,double?radius,String?variant,bool?error, }) : this.label=label??false,this.helper=helper??false,this.hint=hint??'name@example.com',this.value=value??'',this.leading_icon_present=leading_icon_present??true,this.trailing_icon_present=trailing_icon_present??false,this.bg=bg??FlutterFlowTheme.of(context).primaryBackground,this.radius=radius??32.0,this.variant=variant??'outlined',this.error=error??false;
                                                                                          ^^^^^^^
lib/components/text_field_widget.dart:13:475: Error: Method invocation is not a constant expression.
  const TextFieldWidget({super.key , bool?label,bool?helper,String?hint,String?value,this.leading_icon,bool?leading_icon_present,this.trailing_icon,bool?trailing_icon_present,Color?bg,double?radius,String?variant,bool?error, }) : this.label=label??false,this.helper=helper??false,this.hint=hint??'name@example.com',this.value=value??'',this.leading_icon_present=leading_icon_present??true,this.trailing_icon_present=trailing_icon_present??false,this.bg=bg??FlutterFlowTheme.of(context).primaryBackground,this.radius=radius??32.0,this.variant=variant??'outlined',this.error=error??false;
                                                                                          ^^

Side quest: I wanted to manually remove the bg property in the FlutterFlow editor and after doing so, it does not let me save it saying "Current parameters are not properly set.". How do i know what is going wrong?

Expected Behavior

It should build.

Steps to Reproduce

  1. Use the FlutterFlow Designer project (https://designer.flutterflow.io/d/3668a87f-8fdd-4567-aeb7-b4367c168e3b)
  2. Copy the design into FlutterFlow
  3. Press "run app in test mode"

Reproducible from Blank

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

Bug Report Code (Required)

IT4Wz8jf5ZdIseVD1s+MbcJFmiMvNmY6a7grl8N9dEgjfLauBIwPXPykP1doTcOiTFZYMFv9hTgJ7tqMvtrXEOQHA0itGaZfzblhEQnwcDqtVJCwEbiVdHN6HftjJEuV0cHYsBBNPvRuSVlm3WD3euitUhTDJoDUCkUNHP2jOoPD+GziAhm6Xn0Jg1ZSfCvr

Visual documentation

It just fails. No real picture needed.

Environment

- FlutterFlow version: 6.6.82
- Platform: Test Mode. Probably Web?
- Browser name and version: Chrome (fully patched)
- Operating system and version affected: MacOS

Additional Information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions