Migration Guide for ParentDataWidget generics type change#3525
Migration Guide for ParentDataWidget generics type change#3525goderbauer merged 7 commits intoflutter:masterfrom
Conversation
|
|
||
| ## Context | ||
|
|
||
| Prior to this change a ParentDataWidget was bound to a specific RenderObjectWidget type as ancestor. |
There was a problem hiding this comment.
class names should be marked with ``
|
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.
Typo in RenderObjectWidget
| ## 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 |
sfshaza2
left a comment
There was a problem hiding this comment.
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.
Could you move this up, so that it's an alphabetical list? I think. :)
There was a problem hiding this comment.
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.
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.
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.
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.
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. |
Migration guide for flutter/flutter#48541.