-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework teamwaiting for PR to land (fixed)A fix is in flightA fix is in flight
Description
Found in flutter/packages#4746
The KeepAlive ParentDataWidget creates a complication for the proposed TableViewCell, which is also a ParentDataWidget. The actual ParentData of TableViewCell includes the KeepAliveParentDataMixin, so it should be ok for both ParentDataWidgets to contribute to a child's parent data as proposed.
Chatted with @goderbauer about this today.. we think it should be ok to allow this with some assertions
- The type of ParentData of the child should be compatible with both ParentDataWidgets
- TableViewParentData extends TwoDimensionalViewportParentData, which mixes in KeepAliveParentDataMixin, so the parentData is compatible with both KeepAlive and TableViewCell
- The ParentDataWidgets, and the ParentData they write to should be unique
- KeepAlive uses KeepAliveParentDataMixin, TableViewCell uses TableViewParentData, this would be valid ✅
- If two Flexible widgets are trying to contribute to one child's ParentData at the same time, this would not be valid since they could end up overwriting each other ❌
- Applying ParentData should follow the structure of the tree, working from the first ancestor up
This is likely to occur here in framework.dart in RenderObjectElement. We currently assert only one parent can write data, and collect up the 'badAncestors' to assert against:
| ParentDataElement<ParentData>? _findAncestorParentDataElement() { |
LongCatIsLooong
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework teamwaiting for PR to land (fixed)A fix is in flightA fix is in flight
Type
Projects
Status
Done