@@ -229,39 +229,72 @@ final RegExp staticImageTypesRegex =
229
229
return (horizontal: true , vertical: true );
230
230
}
231
231
232
- final bool hasChildren = delegatedNode.childrenOrEmpty.isNotEmpty;
232
+ if (delegatedNode is RowColumnMixin ) {
233
+ final bool hasChildren = delegatedNode.childrenOrEmpty.isNotEmpty;
233
234
234
- if (! hasChildren) {
235
+ if (! hasChildren) {
236
+ return (horizontal: false , vertical: false );
237
+ }
238
+
239
+ for (final id in delegatedNode.childrenOrEmpty) {
240
+ final child = getNode (id);
241
+ isAnyExpandingHorizontally =
242
+ isAnyExpandingHorizontally || child.horizontalFit.isFlex;
243
+ isAnyExpandingVertically =
244
+ isAnyExpandingVertically || child.verticalFit.isFlex;
245
+ }
246
+ return (
247
+ horizontal: ! isAnyExpandingHorizontally,
248
+ vertical: ! isAnyExpandingVertically,
249
+ );
250
+ }
251
+
252
+ if (delegatedNode.childrenOrEmpty.length != 1 ) {
235
253
return (horizontal: false , vertical: false );
236
254
}
237
255
238
- for (final id in delegatedNode.childrenOrEmpty) {
239
- final child = getNode (id);
240
- isAnyExpandingHorizontally =
241
- isAnyExpandingHorizontally || child.horizontalFit.isFlex;
242
- isAnyExpandingVertically =
243
- isAnyExpandingVertically || child.verticalFit.isFlex;
256
+ if (node is ! ScrollableMixin ) return (horizontal: false , vertical: false );
257
+
258
+ final child = getNode (delegatedNode.childrenOrEmpty.first);
259
+
260
+ bool allowHorizontal = true ;
261
+ bool allowVertical = true ;
262
+ if (child.isHorizontalExpanded) allowHorizontal = false ;
263
+ if (child.alignment.data == null || child.alignment.data! .x != - 1 ) {
264
+ allowHorizontal = false ;
265
+ }
266
+ if (child.alignment.data == null &&
267
+ child.outerBoxLocal.left.roundToPrecision (3 ) != 0 ) {
268
+ allowHorizontal = false ;
244
269
}
245
270
246
- return (
247
- horizontal: ! isAnyExpandingHorizontally,
248
- vertical: ! isAnyExpandingVertically,
249
- );
271
+ if (child.isVerticalExpanded) allowVertical = false ;
272
+ if (child.alignment.data != null && child.alignment.data! .y != - 1 ) {
273
+ allowVertical = false ;
274
+ }
275
+ if (child.alignment.data == null &&
276
+ child.outerBoxLocal.top.roundToPrecision (3 ) != 0 ) {
277
+ allowVertical = false ;
278
+ }
279
+
280
+ return (horizontal: allowHorizontal, vertical: allowVertical);
250
281
}
251
282
252
283
({bool horizontal, bool vertical}) checkSelfForLegalScrollableAxes (
253
284
{required BaseNode node}) {
254
- if (node is CanvasNode ) {
255
- return (
256
- horizontal: true ,
257
- vertical: true ,
258
- );
259
- }
260
-
261
- return (
262
- horizontal: node.isHorizontalWrap,
263
- vertical: node.isVerticalWrap,
264
- );
285
+ return (horizontal: true , vertical: true );
286
+
287
+ // if (node is CanvasNode) {
288
+ // return (
289
+ // horizontal: true,
290
+ // vertical: true,
291
+ // );
292
+ // }
293
+ //
294
+ // return (
295
+ // horizontal: node.isHorizontalWrap,
296
+ // vertical: node.isVerticalWrap,
297
+ // );
265
298
}
266
299
267
300
({bool horizontal, bool vertical}) checkParentForLegalScrollableAxes ({
@@ -412,6 +445,12 @@ AlignmentModel retrieveCommonStackAlignment(
412
445
) {
413
446
final List <AlignmentModel > alignments = [];
414
447
448
+ if (nodes.length == 1 &&
449
+ nodes.first is ScrollableMixin &&
450
+ (nodes.first as ScrollableMixin ).isScrollable) {
451
+ return AlignmentModel .none;
452
+ }
453
+
415
454
for (final BaseNode node in nodes) {
416
455
final AlignmentModel alignment = node.alignment;
417
456
if (alignment.data == null ) continue ;
0 commit comments