-
-
Notifications
You must be signed in to change notification settings - Fork 990
feat!: Implements ExpandedComponent #3662
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
base: main
Are you sure you want to change the base?
Conversation
The implementation has gotten so complex, it is no longer practical to try caching the calculation.
Closing to clean up commit history |
Actually, I'll just reopen this. I think you guys squash the commits anyway before merging |
We do indeed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Over all it looks good, just one comment.
Discovered a infinite loop new issue involving nested LinearLayoutComponents (a row inside a column, and the column using CrossAxisAlignment.stretch) These listener interactions are messing with my head T_T |
@spydon i think I may have to do another refactor: One of the bigger challenges I have right now is the fact that a LayoutComponent may want to shrink wrap in one axis, while being explicit in another. For example:
The intent is for Because a lot of the logic around adding and removing listeners centers around the value of |
Sounds good @livtanong |
@spydon this is a significant departure, and I'm almost sure you won't be very happy with this. I introduce Because these are scalars, and aren't notifiers, a lot of logic is moved to the setters of these values. We make a distinction between the size that a layout component is, and the size that a layout component intends to be. The latter is captured by the nullable doubles: layoutWidth and layoutHeight. And a component never needs to listen to the former. It only needs to set the former in reaction to the latter. I have also toyed with the idea of making a So with all this ugliness out and explained--I think this is the only way we can get to properly implementing |
Hmm, it feels a bit dirty... I'd hope there is another way we can solve this without creating new arguments. Would it help if the |
I think the bigger issue right now is a nullable vector 2. Anticipating your discomfort, I've already started working on a NullableVector2. Then after i'll see if I run into any trouble extending it into a NotifyingNullableVector2 with ChangeNotifier. |
Co-authored-by: Lukas Klingsbo <[email protected]>
…expanded-component
Description
Implements an
ExpandedComponent
, which takes up as much space as possible along the main axis within aLinearLayoutComponent
. With more than oneExpandedComponent
, this expansion is divided equally.Checklist
docs
and added dartdoc comments with///
.examples
ordocs
.Breaking Change?
Migration instructions
If the PR is breaking, uncomment this header and add instructions for how to migrate from the
currently released version in-between the two following tags:
PaddingComponent
now inherits fromSingleLayoutComponent
.Related Issues
Closes #3656