FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
121 stars 18 forks source link

Custom Widget is wrapped with "ghost" Container 256x256 #3987

Open stepanic opened 4 days ago

stepanic commented 4 days ago

Can we access your project?

Current Behavior

I created a custom widget called SuperDragAndDrop, and it is used inside the component, which is shown in Custom Dialog.

image

When Dart source is generated around SuperDragAndDrop it is generated Container with 256x256, which is nowhere visible inside of FlutterFlow Editor.

image

This is the solution without a parent Container of Width=512 image

So, in every case, some "ghost" Container with constraints 256x256 is appearing in the generated Dart code. image

Expected Behavior

To have generated a custom widget without that "ghost" parent wrapper 256x256, or without defined width and height constraints, just as an empty widget.

Steps to Reproduce

  1. create custom widget
  2. put custom widget inside of the component

Reproducible from Blank

Bug Report Code (Required)

IT4ehcmB34p2tbxK1rr+KflR/TsvKVAja5JEldVxaAwafIPmOqQIduj+TGZuOLDid2xiPFmWgm0KpqnVhvzhEsACCByJY6ZCyLhyZzn/eEWjVYSVCs6KSHFQP8FPfEihzpuZhhEkAMpfdV4D602qDeqUSXPAQqboPmtAIsmlBLnDnXyVGnroG30Jg1ZSfCvr

Visual documentation

image

image

Environment

- FlutterFlow version: v5.0.3
- Platform: MacOS
- Browser name and version:
- Operating system and version affected:

Additional Information

I have had that issue for the last three months, but I have been ignoring that with a local Dart modification/workaround, where I modify the Dart source with that image

But it is annoying to resolve GIT issues whenever I modify anything in the related parent widget tree :))

Alezanello commented 3 days ago

Hello!

The "ghost" container is automatically created and mimics the width and height you set for the Custom Widget. For example, if you set the Custom Widget to 256x256, the container will adopt the same dimensions. If you set the width and height to "infinite" in your Custom Widget, the container will also mimic this and have infinite dimensions.

image.png image.png
stepanic commented 2 days ago

@Alezanello thank you for the response, but my Widget's implementation looks like this, it is full empty and completely implemented locally outside of the FlutterFlow, so I did not put 256x256 constraints anywhere.

image

stepanic commented 2 days ago

@Alezanello, I tried to modify the custom widget source and recompile it, but I didn't get any error; there was only a warning about the dependency, so I resolved that and recompiled (but everything stayed the same).

Screenshot 2024-10-09 at 09 31 01

It seems that on page UploadTracks the CustomWidget.SuperDragAndDrop lost the reference from the custom widget implementation image

Because when I use the FF option View Code, a completely different source is visible, but when I use Go to implementation in VS Code, the correct Dart file opens.

Screenshot 2024-10-09 at 09 22 09

But the implementation of Custom Widget SuperDragAndDrop is different image

My only idea to fix this is to delete SuperDragAndDrop from the widget tree of the UploadTracks page and insert it again, can you suggest some other option?

This widget is complex because of a lot of custom callbacks, but I didn't get any compilation error from FF image