macosui / macos_ui

Flutter widgets and themes implementing the current macOS design language.
https://macosui.github.io/macos_ui/#/
MIT License
1.84k stars 177 forks source link

(ResizablePane) Add `onResized` call back #501

Open stMerlHin opened 10 months ago

stMerlHin commented 10 months ago

Hey @GroovinChip , it's been a long time since I've heard from you. I hope you are doing well.

Use case

Am using a GridView with dynamic crossAxisCount computed using a factor on MediaQuery.of(conext).size.width. The problem, my calculations are wrong every time the pan is resized.

Video With ResizablePane

Rendering with ResizablePane

Video Without ResizablePane

Rendering without ResizablePane

Proposal

Add something like onPaneRezided call back to ResizablePane which will provide the new size (height or width depending on the pane orientation) of the pane every time resizing action occurs.

Adrian-Samoticha commented 6 months ago

Is there a reason why you couldn’t solve this problem using a LayoutBuilder?