Fix MultiChildLayoutDelegate.hasChild doc (#126433)
fixes https://github.com/flutter/flutter/issues/115898
`hasChild` checks `_idToChild` map. `_idToChild` is not assigned until `_callPerformLayout` is called.
So `hasChild` shouldn't be called in `getSize`.
df789c9e76/packages/flutter/lib/src/rendering/custom_layout.dart (L400-L404)
Updated docs and example class names.
This commit is contained in:
@@ -127,9 +127,11 @@ abstract class MultiChildLayoutDelegate {
|
||||
|
||||
/// True if a non-null LayoutChild was provided for the specified id.
|
||||
///
|
||||
/// Call this from the [performLayout] or [getSize] methods to
|
||||
/// determine which children are available, if the child list might
|
||||
/// vary.
|
||||
/// Call this from the [performLayout] method to determine which children
|
||||
/// are available, if the child list might vary.
|
||||
///
|
||||
/// This method cannot be called from [getSize] as the size is not allowed
|
||||
/// to depend on the children.
|
||||
bool hasChild(Object childId) => _idToChild![childId] != null;
|
||||
|
||||
/// Ask the child to update its layout within the limits specified by
|
||||
|
||||
Reference in New Issue
Block a user