@@ -16,6 +16,7 @@ class LayoutComponentExample1 extends FlameGame with DragCallbacks {
1616 required this .demoSize,
1717 required this .padding,
1818 required this .expandedMode,
19+ required this .paddingInflateChild,
1920 });
2021
2122 static const String description = '''
@@ -31,6 +32,7 @@ the various ways you can change this layout.
3132 final LayoutComponentExampleSize demoSize;
3233 final EdgeInsets padding;
3334 final bool expandedMode;
35+ final bool paddingInflateChild;
3436
3537 @override
3638 FutureOr <void > onLoad () {
@@ -54,6 +56,7 @@ the various ways you can change this layout.
5456 position: Vector2 .zero (),
5557 padding: padding,
5658 expandedMode: expandedMode,
59+ paddingInflateChild: paddingInflateChild,
5760 size: demoSize.toVector2 (),
5861 ),
5962 ],
@@ -83,6 +86,7 @@ class LayoutDemo1 extends LinearLayoutComponent {
8386 required super .position,
8487 required EdgeInsets padding,
8588 required bool expandedMode,
89+ required this .paddingInflateChild,
8690 super .size,
8791 super .key,
8892 }) : _padding = padding,
@@ -96,7 +100,13 @@ class LayoutDemo1 extends LinearLayoutComponent {
96100 set expandedMode (bool value) {
97101 _expandedMode = value;
98102 removeAll (children.toList ());
99- addAll (createComponentList (expandedMode: expandedMode, padding: padding));
103+ addAll (
104+ createComponentList (
105+ expandedMode: expandedMode,
106+ padding: padding,
107+ inflateChild: paddingInflateChild,
108+ ),
109+ );
100110 }
101111
102112 EdgeInsets _padding = EdgeInsets .zero;
@@ -108,10 +118,18 @@ class LayoutDemo1 extends LinearLayoutComponent {
108118 paddingComponent? .padding = padding;
109119 }
110120
121+ final bool paddingInflateChild;
122+
111123 @override
112124 FutureOr <void > onLoad () {
113125 super .onLoad ();
114- addAll (createComponentList (expandedMode: expandedMode, padding: padding));
126+ addAll (
127+ createComponentList (
128+ expandedMode: expandedMode,
129+ padding: padding,
130+ inflateChild: paddingInflateChild,
131+ ),
132+ );
115133 }
116134
117135 PaddingComponent ? get paddingComponent {
@@ -124,6 +142,7 @@ class LayoutDemo1 extends LinearLayoutComponent {
124142 static List <Component > createComponentList ({
125143 required bool expandedMode,
126144 required EdgeInsets padding,
145+ required bool inflateChild,
127146 }) {
128147 return [
129148 TextComponent (text: 'Some short text' ),
@@ -143,6 +162,7 @@ class LayoutDemo1 extends LinearLayoutComponent {
143162 ExpandedComponent (
144163 child: PaddingComponent (
145164 padding: padding,
165+ inflateChild: inflateChild,
146166 child: RectangleComponent (
147167 size: Vector2 (96 , 96 ),
148168 paint: Paint ()..color = Colors .blue,
@@ -152,6 +172,7 @@ class LayoutDemo1 extends LinearLayoutComponent {
152172 else
153173 PaddingComponent (
154174 padding: padding,
175+ inflateChild: inflateChild,
155176 child: RectangleComponent (
156177 size: Vector2 (96 , 96 ),
157178 paint: Paint ()..color = Colors .blue,
0 commit comments