flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
165.36k stars 27.28k forks source link

RenderBox was not laid out: #126400

Closed DineshIT closed 1 year ago

DineshIT commented 1 year ago
The following assertion was thrown during paint():
RenderBox was not laid out: RenderRepaintBoundary#474ad relayoutBoundary=up2 NEEDS-LAYOUT NEEDS-PAINT
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2001 pos 12: 'hasSize'

The relevant error-causing widget was: 
  LayoutBuilder LayoutBuilder:file:///D:/Novatium%20Git/Android%20EV/ev_new_update/lib/ui/booking_ui/booking_page_new_optimized.dart:559:13
When the exception was thrown, this was the stack: 
#2      RenderBox.size (package:flutter/src/rendering/box.dart:2001:12)
#3      RenderBox.paintBounds (package:flutter/src/rendering/box.dart:2666:41)
#4      PaintingContext._repaintCompositedChild (package:flutter/src/rendering/object.dart:154:56)
#5      PaintingContext.repaintCompositedChild (package:flutter/src/rendering/object.dart:98:5)
#6      PaintingContext._compositeChild (package:flutter/src/rendering/object.dart:250:7)
#7      PaintingContext.paintChild (package:flutter/src/rendering/object.dart:231:7)
#8      _RenderLayoutBuilder.paint (package:flutter/src/widgets/layout_builder.dart:341:15)
#9      RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2796:7)
#10     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:239:13)
#11     RenderBoxContainerDefaultsMixin.defaultPaint (package:flutter/src/rendering/box.dart:2900:15)
#12     RenderCustomMultiChildLayoutBox.paint (package:flutter/src/rendering/custom_layout.dart:415:5)
#13     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2796:7)
#14     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:239:13)
#15     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:144:15)
#16     _RenderInkFeatures.paint (package:flutter/src/material/material.dart:609:11)
#17     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2796:7)
#18     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:239:13)
#19     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:144:15)
#20     RenderPhysicalModel.paint.<anonymous closure> (package:flutter/src/rendering/proxy_box.dart:2098:15)
#21     PaintingContext.pushClipRRect (package:flutter/src/rendering/object.dart:550:14)
#22     RenderPhysicalModel.paint (package:flutter/src/rendering/proxy_box.dart:2085:21)
#23     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2796:7)
#24     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:239:13)
#25     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:144:15)
#26     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2796:7)
#27     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:239:13)
#28     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:144:15)
#29     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2796:7)
#30     PaintingContext._repaintCompositedChild (package:flutter/src/rendering/object.dart:155:11)
#31     PaintingContext.repaintCompositedChild (package:flutter/src/rendering/object.dart:98:5)
#32     PipelineOwner.flushPaint (package:flutter/src/rendering/object.dart:1116:31)
#33     RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:515:19)
#34     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:884:13)
#35     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:378:5)
#36     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1175:15)
#37     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1104:9)
#38     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1015:5)
#39     _invoke (dart:ui/hooks.dart:148:13)
#40     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:318:5)
#41     _drawFrame (dart:ui/hooks.dart:115:31)
(elided 2 frames from class _AssertionError)
The following RenderObject was being processed when the exception was fired: _RenderLayoutBuilder#09b05 relayoutBoundary=up1
...  needs compositing
...  parentData: offset=Offset(0.0, 0.0); id=_ScaffoldSlot.body (can use size)
...  constraints: BoxConstraints(0.0<=w<=411.4, 0.0<=h<=783.4)
...  size: MISSING
RenderObject: _RenderLayoutBuilder#09b05 relayoutBoundary=up1
  needs compositing
  parentData: offset=Offset(0.0, 0.0); id=_ScaffoldSlot.body (can use size)
  constraints: BoxConstraints(0.0<=w<=411.4, 0.0<=h<=783.4)
  size: MISSING
...  child: RenderRepaintBoundary#474ad relayoutBoundary=up2 NEEDS-LAYOUT NEEDS-PAINT
...    needs compositing
...    parentData: offset=Offset(0.0, 0.0) (can use size)
...    constraints: BoxConstraints(0.0<=w<=411.4, 0.0<=h<=783.4)
...    layer: OffsetLayer#146f2 DETACHED
...      handles: 1
...      offset: Offset(0.0, 0.0)
...    size: MISSING
...    metrics: 0.0% useful (2 bad vs 0 good)
...    diagnosis: insufficient data to draw conclusion (less than five repaints)
...    child: RenderCustomPaint#8ee17 relayoutBoundary=up3 NEEDS-LAYOUT NEEDS-PAINT
...      needs compositing
...      parentData: <none> (can use size)
...      constraints: BoxConstraints(0.0<=w<=411.4, 0.0<=h<=783.4)
...      size: MISSING
...      painter: null
...      foregroundPainter: _GlowingOverscrollIndicatorPainter(_GlowController(color: Color(0xff2196f3), axis: vertical), _GlowController(color: Color(0xff2196f3), axis: vertical))
...      child: RenderRepaintBoundary#5f693 relayoutBoundary=up4 NEEDS-LAYOUT NEEDS-PAINT
...        needs compositing
...        parentData: <none> (can use size)
...        constraints: BoxConstraints(0.0<=w<=411.4, 0.0<=h<=783.4)
...        size: MISSING
...        usefulness ratio: no metrics collected yet (never painted)
...        child: _RenderScrollSemantics#a32ca relayoutBoundary=up5 NEEDS-LAYOUT NEEDS-PAINT
...          needs compositing
...          parentData: <none> (can use size)
...          constraints: BoxConstraints(0.0<=w<=411.4, 0.0<=h<=783.4)
...          semantic boundary
...          size: MISSING
darshankawar commented 1 year ago

@DineshIT In order to properly address the issue reported, please provide flutter doctor -v and a complete minimal reproducible code sample.

github-actions[bot] commented 1 year ago

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones. Thanks for your contribution.

github-actions[bot] commented 1 year ago

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.