-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Migration Guide for ParentDataWidget generics type change #3525
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
Conversation
|
|
||
| ## Context | ||
|
|
||
| Prior to this change a ParentDataWidget was bound to a specific RenderObjectWidget type as ancestor. |
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.
class names should be marked with ``
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.
Done.
|
LGTM, cc @sfshaza2 |
| Prior to this change a `ParentDataWidget` was bound to a specific `RenderObjectWidget` type as | ||
| ancestor. For example, a `Positioned` widget could only be used within a `Stack` widget. With this | ||
| change, a `ParentDataWidget` can be used with any `RenderObjectWidget` type as ancestor as long as | ||
| the `RenderObject` of said R`enderObjectWidget` sets up the correct `ParentData` type. In this new |
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.
Typo in RenderObjectWidget
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.
Fixed.
| ## Description of change | ||
|
|
||
| The generic type argument of `ParentDataWidget` has been changed from `RenderObjectWidget` to | ||
| `ParentData` and a new debug property `debugTypicalAncestorWidgetClass` has been added to |
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.
ParentData, and
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.
Fixed.
sfshaza2
left a comment
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.
Overall, looks good! Just a few requested tweaks.
| * [TextInputClient currentTextEditingValue] | ||
| * [TestTextInput] | ||
| * [Scrollable AlertDialog] | ||
| * [Generic type of ParentDataWidget changed to ParentData] |
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.
Could you move this up, so that it's an alphabetical list? I think. :)
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.
I did move this up. Although, I am wondering if this list should be in "chronological" order instead. When I look at the list, I am probably only interested in the latest guides ("what requires migration since my last upgrade of Flutter?") and don't want to scroll through the guides that are 25 versions old?
| description: The ParentDataWidget is now bound to the ParentData type. | ||
| --- | ||
|
|
||
| # Generic type of `ParentDataWidget` changed to `ParentData` |
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.
Can you pull the latest into your repo? I just landed a PR that updates the template. We don't want a level 1 header, since the website generates that automatically. Instead, I'd like to see a level 2 "Summary" header.
|
|
||
| ## Context | ||
|
|
||
| Prior to this change a `ParentDataWidget` was bound to a specific `RenderObjectWidget` type as |
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.
THANKS FOR WRITING IN PAST TENSE!!! You are the first one to do that :)
| ## Description of change | ||
|
|
||
| The generic type argument of `ParentDataWidget` has been changed from `RenderObjectWidget` to | ||
| `ParentData`, and a new debug property `debugTypicalAncestorWidgetClass` has been added to |
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.
Add commas before and after debugTypicalAncestorWidgetClass. (And thanks for code fonting!)
| ## References | ||
|
|
||
| API documentation: | ||
| * https://api.flutter.dev/flutter/widgets/ParentDataWidget-class.html |
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.
Can you tweak?
API documentation:
* [`ParentDataWidget`]
Relevant PR:
* [Make ParentDataWidget usable with different ancestor RenderObjectWidget types]
[Make ParentDataWidget usable with different ancestor RenderObjectWidget types]: {{site.github}}/flutter/flutter/pull/48541
[`ParentDataWidget`]: {{site.api}}/flutter/widgets/ParentDataWidget-class.html
|
Since I just landed a PR for this directory, you'll need to pull in the changes and fix the conflicts. Thanks! |
b53fa6d to
b531a05
Compare
|
Thanks for the review, @Sfshaza. I addressed all comments, PTAL. |
sfshaza2
left a comment
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.
LGTM
Migration guide for flutter/flutter#48541.