caduandrade / multi_split_view

Provides horizontal or vertical multiple split view for Flutter.
MIT License
152 stars 29 forks source link

Minimal size for each child #20

Closed stx closed 2 years ago

stx commented 2 years ago

Thanks for your work on this great plugin!

We have a pretty simple use case: we want column A to be resizable down to a minimum of 100px, and column B to be resizable down to a minimum of 200px, and so on. As far as I can tell this is not readily achievable. If we're missing it, let me know. :)

caduandrade commented 2 years ago

You are right. Currently, the minimum size can only be configured globally.

caduandrade commented 2 years ago

I just don't know yet what would be the most "elegant" API for the developer. Maybe a Map to define the minimum size of only the columns that interest. Maybe an array that requires a set for all columns but accepts double.nan value (for example) for columns with no minimum size. Maybe change everything?! :slightly_smiling_face: :see_no_evil:

stx commented 2 years ago

Intuitively the property I was looking for was minimumSizes. This would be an array that matches the children length. 0 for no minimum.

minimumSizes: [100, 200, 0]

caduandrade commented 2 years ago

The minimalWeight and minimalSize should be refactored to globalMinimalWeight and globalMinimalSize.

caduandrade commented 2 years ago

@stx , It's done. 1.13.0 released. If anything else is missing, let me know. If you can register a like on pub.dev or a star here on Github, I'd appreciate it!