bdlukaa / fluent_ui

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

🐛 DatePicker throws Exception: A RenderListWheelViewport was mutated in _RenderLayoutBuilder.performLayout. #1117

Closed pamtbaau closed 4 days ago

pamtbaau commented 2 months ago

Describe the bug A clear and concise description of what the bug is.

When changing the value of a DatePicker by scrolling the date, an exception is thrown when setState() is called in onChanged.

Workaround until fixed: Wrap setState() inside a Future.delayed():

      onChanged: (value) {
        Future.delayed(const Duration(milliseconds: 500), () {
          setState(() {
            selected = value;
          });
        });
      },

To Reproduce Steps to reproduce the behavior:

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

bdlukaa commented 2 months ago

We are calling onChanged before popping the picker. I believe changing this order fixes this issue.

MiaraSystems commented 1 month ago

I see the same issue.