flutter_layout_grid icon indicating copy to clipboard operation
flutter_layout_grid copied to clipboard

Draggable gaps ?

Open tlvenn opened this issue 2 years ago • 1 comments

Hi,

I am wondering if the layout can / could support draggable gaps where one gap (a separation between 2 content panes) is draggable to adjust the size / ratio of those 2 panes.

Something like this: CleanShot 2022-05-16 at 18 36 27

At the same time, maybe this whole thing and a state manager to save the updated layout should be build on top of this project rather than integrated with it...

tlvenn avatar May 16 '22 10:05 tlvenn

+1 on the feature request.

I actually got an idea how this could be accomplished:

  1. create a Splitter/DraggableSeparator widget or sth like that
  2. use GestureDetector to catch drag events
  3. bind a callback to a handler that changes the values in columnSizes/rowSizes

This has the drawback of eliminating the need for a rowGap/columnGap, as the splitter replaces the gap. (OTOH you could also use the gap to make only part of the gap draggable using the splitter)

I just discovered this lib and think its awesome. This feature would be a great improvement nonetheless. Maybe I can play around with the idea. Are there better approaches?

ricardoboss avatar Feb 28 '23 23:02 ricardoboss