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:
Taha Tesser
2023-05-11 17:59:07 +03:00
committed by GitHub
parent 42d9a2b3fa
commit 12659f2a7b
3 changed files with 14 additions and 12 deletions

View File

@@ -12,7 +12,7 @@ void main() {
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
body: example.ExampleWidget(),
body: example.CustomMultiChildLayoutApp(),
),
),
);
@@ -24,7 +24,7 @@ void main() {
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
body: example.ExampleWidget(),
body: example.CustomMultiChildLayoutExample(),
),
),
);
@@ -40,7 +40,7 @@ void main() {
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
body: example.ExampleWidget(),
body: example.CustomMultiChildLayoutExample(),
),
),
);