diff --git a/examples/api/lib/widgets/basic/custom_multi_child_layout.0.dart b/examples/api/lib/widgets/basic/custom_multi_child_layout.0.dart index 334cb5ef37..92ab2a2cc6 100644 --- a/examples/api/lib/widgets/basic/custom_multi_child_layout.0.dart +++ b/examples/api/lib/widgets/basic/custom_multi_child_layout.0.dart @@ -6,10 +6,10 @@ import 'package:flutter/material.dart'; /// Flutter code sample for [CustomMultiChildLayout]. -void main() => runApp(const ExampleApp()); +void main() => runApp(const CustomMultiChildLayoutApp()); -class ExampleApp extends StatelessWidget { - const ExampleApp({super.key}); +class CustomMultiChildLayoutApp extends StatelessWidget { + const CustomMultiChildLayoutApp({super.key}); @override Widget build(BuildContext context) { @@ -19,7 +19,7 @@ class ExampleApp extends StatelessWidget { // see the layout change. textDirection: TextDirection.ltr, child: Scaffold( - body: ExampleWidget(), + body: CustomMultiChildLayoutExample(), ), ), ); @@ -82,8 +82,8 @@ class _CascadeLayoutDelegate extends MultiChildLayoutDelegate { } } -class ExampleWidget extends StatelessWidget { - const ExampleWidget({super.key}); +class CustomMultiChildLayoutExample extends StatelessWidget { + const CustomMultiChildLayoutExample({super.key}); static const Map _colors = { 'Red': Colors.red, diff --git a/examples/api/test/widgets/basic/custom_multi_child_layout.0_test.dart b/examples/api/test/widgets/basic/custom_multi_child_layout.0_test.dart index c762a58f40..acd087ba8e 100644 --- a/examples/api/test/widgets/basic/custom_multi_child_layout.0_test.dart +++ b/examples/api/test/widgets/basic/custom_multi_child_layout.0_test.dart @@ -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(), ), ), ); diff --git a/packages/flutter/lib/src/rendering/custom_layout.dart b/packages/flutter/lib/src/rendering/custom_layout.dart index bd3e6fefaa..e5ddee8628 100644 --- a/packages/flutter/lib/src/rendering/custom_layout.dart +++ b/packages/flutter/lib/src/rendering/custom_layout.dart @@ -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