@@ -73,13 +73,16 @@ class PassiveRectangleWidget extends StatelessWidget {
7373 Widget build (BuildContext context) {
7474 final ScopedValues scopedValues = ScopedValues .of (context);
7575
76- // final BaseNode? parent = node.id == kRootNode || node.parentID == kRootNode
77- // ? null
78- // : getNode(node.parentID);
76+ final BaseNode ? parent = node.id == kRootNode || node.parentID == kRootNode
77+ ? null
78+ : manager.getNode (node.parentID);
79+ bool isPlaceholder =
80+ parent is CanvasNode && parent.properties.bodyId == node.id;
7981
8082 /// TODO Birju / Saad. Why does the commented out parent code below break published layouts only?
8183 /// Saad's note: The below code looks like AdaptiveNodeBox
82- final double ? width = (node.horizontalFit == SizeFit .shrinkWrap)
84+ final double ? width = (node.horizontalFit == SizeFit .shrinkWrap ||
85+ isPlaceholder)
8386 ? null
8487 : (node.horizontalFit ==
8588 SizeFit
@@ -89,7 +92,8 @@ class PassiveRectangleWidget extends StatelessWidget {
8992 ? double .infinity
9093 : node.basicBoxLocal.width;
9194
92- final double ? height = (node.verticalFit == SizeFit .shrinkWrap)
95+ final double ? height = (node.verticalFit == SizeFit .shrinkWrap ||
96+ isPlaceholder)
9397 ? null
9498 : (node.verticalFit ==
9599 SizeFit
@@ -138,25 +142,11 @@ class PassiveRectangleWidget extends StatelessWidget {
138142 ...buildFills (
139143 node,
140144 useInk: false ,
141- // useInk: node is BlendMixin &&
142- // (node as BlendMixin).inkWell != null &&
143- // settings.useInk,
144145 obscureImages: settings.obscureImages,
145146 settings: settings,
146147 scopedValues: scopedValues,
147148 ),
148149 ...buildStrokes (node, scopedValues),
149- // old
150- // ...wrapWithPaddingAndScroll(
151- // node,
152- // [
153- // ...children,
154- // if (portalWidget != null) portalWidget,
155- // ],
156- // stackAlignment: stackAlignment,
157- // applyPadding: applyPadding,
158- // ),
159-
160150 ...wrapWithInkWell (
161151 context,
162152 node,
@@ -170,37 +160,6 @@ class PassiveRectangleWidget extends StatelessWidget {
170160 applyPadding: applyPadding,
171161 ),
172162 ),
173-
174- // Builder(builder: (context) {
175- // final child = Stack(
176- // children: [
177- // ...wrapWithPaddingAndScroll(
178- // node,
179- // [
180- // ...children,
181- // if (portalWidget != null) portalWidget,
182- // ],
183- // stackAlignment: stackAlignment,
184- // applyPadding: applyPadding,
185- // ),
186- // ],
187- // );
188- //
189- // if (node is BlendMixin && (node as BlendMixin).inkWell != null) {
190- // return Material(
191- // type: MaterialType.transparency,
192- // child: InkWell(
193- // onLongPress: () {},
194- // onTap: () {
195- // // TODO:
196- // },
197- // child: child,
198- // ),
199- // );
200- // }
201- //
202- // return child;
203- // }),
204163 ],
205164 ),
206165 );
0 commit comments