File tree Expand file tree Collapse file tree 3 files changed +14
-12
lines changed
packages/flutter/lib/src/rendering Expand file tree Collapse file tree 3 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,10 @@ import 'package:flutter/material.dart';
6
6
7
7
/// Flutter code sample for [CustomMultiChildLayout] .
8
8
9
- void main () => runApp (const ExampleApp ());
9
+ void main () => runApp (const CustomMultiChildLayoutApp ());
10
10
11
- class ExampleApp extends StatelessWidget {
12
- const ExampleApp ({super .key});
11
+ class CustomMultiChildLayoutApp extends StatelessWidget {
12
+ const CustomMultiChildLayoutApp ({super .key});
13
13
14
14
@override
15
15
Widget build (BuildContext context) {
@@ -19,7 +19,7 @@ class ExampleApp extends StatelessWidget {
19
19
// see the layout change.
20
20
textDirection: TextDirection .ltr,
21
21
child: Scaffold (
22
- body: ExampleWidget (),
22
+ body: CustomMultiChildLayoutExample (),
23
23
),
24
24
),
25
25
);
@@ -82,8 +82,8 @@ class _CascadeLayoutDelegate extends MultiChildLayoutDelegate {
82
82
}
83
83
}
84
84
85
- class ExampleWidget extends StatelessWidget {
86
- const ExampleWidget ({super .key});
85
+ class CustomMultiChildLayoutExample extends StatelessWidget {
86
+ const CustomMultiChildLayoutExample ({super .key});
87
87
88
88
static const Map <String , Color > _colors = < String , Color > {
89
89
'Red' : Colors .red,
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ void main() {
12
12
await tester.pumpWidget (
13
13
const MaterialApp (
14
14
home: Scaffold (
15
- body: example.ExampleWidget (),
15
+ body: example.CustomMultiChildLayoutApp (),
16
16
),
17
17
),
18
18
);
@@ -24,7 +24,7 @@ void main() {
24
24
await tester.pumpWidget (
25
25
const MaterialApp (
26
26
home: Scaffold (
27
- body: example.ExampleWidget (),
27
+ body: example.CustomMultiChildLayoutExample (),
28
28
),
29
29
),
30
30
);
@@ -40,7 +40,7 @@ void main() {
40
40
await tester.pumpWidget (
41
41
const MaterialApp (
42
42
home: Scaffold (
43
- body: example.ExampleWidget (),
43
+ body: example.CustomMultiChildLayoutExample (),
44
44
),
45
45
),
46
46
);
Original file line number Diff line number Diff line change @@ -127,9 +127,11 @@ abstract class MultiChildLayoutDelegate {
127
127
128
128
/// True if a non-null LayoutChild was provided for the specified id.
129
129
///
130
- /// Call this from the [performLayout] or [getSize] methods to
131
- /// determine which children are available, if the child list might
132
- /// vary.
130
+ /// Call this from the [performLayout] method to determine which children
131
+ /// are available, if the child list might vary.
132
+ ///
133
+ /// This method cannot be called from [getSize] as the size is not allowed
134
+ /// to depend on the children.
133
135
bool hasChild (Object childId) => _idToChild! [childId] != null ;
134
136
135
137
/// Ask the child to update its layout within the limits specified by
You can’t perform that action at this time.
0 commit comments