Skip to content

Add a CrossAxisAlignment to Flex to fill the available cross space#1551

Merged
cmyr merged 2 commits intolinebender:masterfrom
tirix:master
Jan 31, 2021
Merged

Add a CrossAxisAlignment to Flex to fill the available cross space#1551
cmyr merged 2 commits intolinebender:masterfrom
tirix:master

Conversation

@tirix
Copy link
Contributor

@tirix tirix commented Jan 24, 2021

This is for introducing a new enum value Fill to Flex's CrossAxisAlignment.
Children with the Fill cross axis alignment are laid out to fill the entire available cross space, resulting in such layouts:
image
The same layout using Startlooks like this:
image

Copy link
Member

@cmyr cmyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense, and I think it's worth trying, although there are some possible gotchas: for instance the user might expect to be able to use SizedBox::expand here in order to use the available space but that will end up in calculating an infinite size in the first layout pass.

I think it's worth getting this in though and seeing if that ends up being a problem in practice, I can see the real benefit here. :)

Thanks!

Co-authored-by: Colin Rofls <colin@cmyr.net>
@cmyr cmyr merged commit 4c865b9 into linebender:master Jan 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants