caduandrade / multi_split_view

Provides horizontal or vertical multiple split view for Flutter.
https://caduandrade.github.io/multi_split_view/
MIT License
129 stars 24 forks source link

Size and Flex #67

Closed DanielFerrariR closed 2 weeks ago

DanielFerrariR commented 3 weeks ago

Hello, thanks for creating this library!

I was just using two areas in version 2.4.0:

Area(size: 256, minimalSize: 256), Area(minimalWeight: 0.5))

But can't replicate the same behaviour with the last version of this library (3.1.0). The closest I managed to do was:

Area(size: 256, min: 256), Area(flex: 1, min: 1)

Which works almost the same, but the min in the flex area doesn't work and I can reduce the area as much as possible. Is it a bug or an intended change?

Best!

caduandrade commented 2 weeks ago

Hi @DanielFerrariR !

Hi. It's not a bug but I understand that it's an unthought-out situation. Before there was no size per pixel and that was confusing. This pixel size was just an initial one and converted to "weight". The real fixed pixel size was highly requested. But in your case, as there is only one flex area, the minimum size does not make sense because the flex fills all the remaining space beyond the fixed pixel.

I don't really know how the API could handle such a case.

DanielFerrariR commented 2 weeks ago

Thanks, I was just unsure if it was a bug. As the old setting doesn't work, I will just go with:

Area(flex: 1, min: 1), Area(flex: 3, min: 2)

Which is pretty much the same, but with percentages.

Best.