bdlukaa / fluent_ui

Implements Microsoft's WinUI3 in Flutter.
https://bdlukaa.github.io/fluent_ui/
BSD 3-Clause "New" or "Revised" License
2.82k stars 442 forks source link

🐛 Unexpected jitter on `MenuFlyoutSubItem` appears #1014

Open TENX-S opened 6 months ago

TENX-S commented 6 months ago

When the MenuFlyoutSubItem appears, it quickly moves a short distance to the lower right corner.

https://github.com/bdlukaa/fluent_ui/assets/40336192/8d3a0592-5ce8-4058-b8ab-de450ca35bec

TENX-S commented 6 months ago

This behavior can be confirmed in the example app too. image

bdlukaa commented 4 months ago

This is probably because of the following lines:

https://github.com/bdlukaa/fluent_ui/blob/9c0840dc33af9d0641285b22dcda4bc553159db3/lib/src/controls/flyouts/content_manager.dart#L63-L72

The sub items doesn't get to know the box size at the very first frame, causing this jitter.

TENX-S commented 4 months ago

Yeah. I think that is the root cause. I build and run the example without the post frame callback, and the jitter is gone. But the FlyoutListTile size doesn't get right:

image
bdlukaa commented 4 months ago

Yeah. To fix this, we'd need to make use of Flutter box system - which is kind of complex. We already do it for other widgets, like ComboBox.