Skip to content

Change Flexible's default FlexFit #7404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 10, 2017
Merged

Conversation

abarth
Copy link
Contributor

@abarth abarth commented Jan 10, 2017

Previously, Flexible defaulted to FlexFit.tight, which forced the child to
expand to fill the available space. Now, Flexible defaults to
FlexFit.loose, which does not force the child to expand to fill the available
space.

If you want the child to expand to fill the available space, consider using
Expanded instead.

Fixes #5169

@abarth
Copy link
Contributor Author

abarth commented Jan 10, 2017

@Hixie @HansMuller

@@ -2229,17 +2229,27 @@ class Column extends Flex {

/// A widget that controls how a child of a [Row], [Column], or [Flex] flexes.
///
/// Using a [Flexible] widget to gives a child of a [Row], [Column], or [Flex]
Copy link
Contributor

Choose a reason for hiding this comment

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

s/to//

@@ -2298,9 +2308,13 @@ class Flexible extends ParentDataWidget<Flex> {
/// the available space is divided amoung them according to the [flex] factor.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/Using/Use/ or s/to make/makes/.

@Hixie
Copy link
Contributor

Hixie commented Jan 10, 2017

I'm a little concerned that flipping the default broke no tests, but, LGTM!

@abarth
Copy link
Contributor Author

abarth commented Jan 10, 2017

I'm a little concerned that flipping the default broke no tests, but, LGTM!

I did a previous CL where I migrated everyone to Expanded.

Previously, `Flexible` defaulted to `FlexFit.tight`, which forced the child to
expand to fill the available space. Now, `Flexible` defaults to
`FlexFit.loose`, which does not force the child to expand to fill the available
space.

If you want the child to expand to fill the available space, consider using
`Expanded` instead.

Fixes flutter#5169
@Hixie
Copy link
Contributor

Hixie commented Jan 10, 2017

Sure but that means there was no test verifying that not giving any arguments to Flexible meant it was treated like Expanded. Or vice versa now. :-)

@abarth
Copy link
Contributor Author

abarth commented Jan 10, 2017

There were previously, but I guess I removed them when I migrated them to Expanded. It's fair that I should add one back now given that I'm changing behavior in this patch.

@abarth abarth merged commit 03d1980 into flutter:master Jan 10, 2017
@abarth abarth deleted the change_flexible branch January 10, 2017 21:12
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename Flexible to Expand and Fit
3 participants