Skip to content

Unable to import custom components in Custom Widgets #998

@danielmeza

Description

@danielmeza

Has your issue been reported?

  • I have searched the existing issues and confirm it has not been reported.
  • 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

Since some core features from flutter are not implemented yet in FF, like Dismissible, it's commonly to use wrapper pattern to provide the missing feature and wrap a custom component inside that wrapper and this way complete the missing feature.

For that reason, Custom Widgets are perfect to provide missing features like this CustomWidget(child: CustomComponent()), this way we can keep the design and interaction logic inside the Custom Component and implement the missing feature in the Custom Widget.

When I try to do that, I hit an error waying that the custom component file wasn't found or does not exist.

I report hits as an issue because this is totally posible out off the editor, and in some case the compiler just works, but most of the times it fails whit the error I describe before. I know that the correct way to do this is to allow Custom widget to receive child items as parameter but as that may require extra effort to implement, by fixing this issue FF can provide us with a work around until child widget can be used in te platform.

Notice that if I disable compilation the project work as expected, the same if I download the code and run it locally.

Custom Widget that implements Dismissible, consume the AvailableBetItemWidget
Screenshot 2023-06-16 123256

The AvailableBetItem widget
Screenshot 2023-06-16 123132

Screenshot 2023-06-16 123401

Screenshot 2023-06-16 125231

Expected Behavior

The compiler allows to link custom components from custom widgets.

Steps to Reproduce

  1. Create a custom component in the editor.
  2. Create a custom widget.
  3. Reference the custom component inside the custom widget
  4. Use the component as a child in the custom widget.
  5. Build the project.

Reproducible from Blank

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

Bug Report Code (Required)

IT5Xlcr1z4xOsdtF7s/uYO9VhjwROVg/a7geltZxYw81F4zqP7AfOvf+T3FdOLynSnxIOWGjnnIIp9KKkobpFsABC0iIQ705wblhVQGWfHulb5iqC6qKOUB8EeJRN3Kh56COih5/CNtqSEIT73GAe9+WfDDaJ4T6IlYFAf+kWabD+l6ULgDsFDh2tmNecCfn

Context

read current behavior

Visual documentation

read current behavior

Additional Info

No response

Environment

- FlutterFlow version: 
- Platform:
- Browser name and version:
- Operating system and version affected:

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions