Skip to content

OverlayPortal in Table/TableRow crashes when OverlayPortalController.show is called before the OverlayPortalController is assigned to the OverlayPortal #174133

Closed

Description

@TB-StarcMed

I have a Flutter project that runs fine with Flutter SDK 3.32.X, but crashes at a specific point after upgrading to Flutter 3.35.1. I am not allowed to disclose this project and therefore derived a smaller version from it:

overlay_portal_assertion.zip

The output from the debug console is contained in the "debug console.txt" within the folder of the project.

To cause the exception:

  1. Execute the application in debug mode,
  2. Click the Button (with label "Login") and
  3. Click the button on the right (with label "Tools"). Then the exception is triggered.

Flutter doctor output when having and using Flutter 3.35.1:

[√] Flutter (Channel stable, 3.35.1, on Microsoft Windows [Version 10.0.26100.4946], locale de-DE) [230ms]
    • Flutter version 3.35.1 on channel stable at C:\Progs\Flutter\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 20f8274939 (6 days ago), 2025-08-14 10:53:09 -0700
    • Engine revision 1e9a811bf8
    • Dart version 3.9.0
    • DevTools version 2.48.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-lldb-debugging

[√] Windows Version (11 Pro 64-bit, 24H2, 2009) [2,1s]

[√] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [1.645ms]
    • Android SDK at C:\Progs\Android\SDK
    • Emulator version 36.1.9.0 (build_id 13823996) (CL:N/A)
    • Platform android-36, build-tools 36.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.6+-13391695-b895.109)
    • All Android licenses accepted.

[√] Chrome - develop for the web [70ms]
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.14.12) [69ms]
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.14.36408.4
    • Windows 10 SDK version 10.0.26100.0

[√] Android Studio (version 2025.1.2) [13ms]
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.6+-13391695-b895.109)

[√] VS Code, 64-bit edition (version 1.103.1) [11ms]
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.116.0

[√] Connected device (3 available) [174ms]
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.26100.4946]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 139.0.7258.128
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 137.0.3296.93

[√] Network resources [267ms]
    • All expected network resources are available.

• No issues found!

For running the app with Flutter 3.32.8:

  1. Go to the folder with the Flutter SDK,
  2. Switch the working copy to branch "3.32.8",
  3. Run "flutter doctor -v" to let adjust to the switched branch,
  4. Change the version for the Dart sdk under "environment:" "sdk:" to "^3.8.1" in file pubspec.yaml of the project,
  5. Run "flutter pub get" to update the packages.
  6. Execute the app in debug mode and execute the same steps as above.

To revert to the latest SDK:

  1. Execute "flutter channel stable",
  2. Execute "flutter doctor -v"
  3. Change the version for the Dart SDK back to 3.9.0 in file pubspec.yaml of the project,
  4. Run "flutter pub get" to update the packages.

Activity

  1. ruicraveiro commented on Aug 21, 2025

    @ruicraveiro
  2. darshankawar commented on Aug 21, 2025

    @darshankawar
    Member

    @TB-StarcMed Thanks for the report and code. I was able to replicate this on latest sdk, but looking at the code you provided, it seem to still have lot of implementation and is not minimal. What we would like to have is a minimal but complete runnable code sample (ex: only main.dart) that still triggers the reported error. You may remove unrelated implementations like localization and other implementations which isn't required to trigger this error and just provide us updated code.

  3. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Aug 21, 2025
  4. TB-StarcMed commented on Aug 21, 2025

    @TB-StarcMed
    Author

    @darshankawar I made a more minimalistic variant that still produces the error:

    overlay_portal_assertion (2).zip

    I have figured out now that going to the previous Flutter version is achievable by executing:

    1. "flutter downgrade",
    2. "flutter doctor",
    3. "flutter pub get".

    The upgrade back to the latest Flutter SDK then works by executing:

    1. "flutter upgrade",
    2. "flutter pub get".

    The Dart SDK option does not need to be changed to "^3.9.0" when switching to the latest Flutter SDK, since the value "^3.8.1" works for both Flutter SDKs.

    I have added git to the folder in case someone wants to switch to an earlier version of the project.

    As a hint to the possible cause: When I commented out the Category4Widget in the original version, the error disappears. Since the widget contains some sliders, it think it is likely that the error is related to the Slider widget.

  5. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Aug 21, 2025
  6. darshankawar commented on Aug 22, 2025

    @darshankawar
    Member

    Thanks for the update. I was able to replicate this on latest stable and master but not in 3.32.8 in which the app renders properly showing the slider as below:

    Image

    In latest versions, it throws the error as below:

    error log
    ======== Exception caught by widgets library =======================================================
    The following assertion was thrown building OverlayPortal(dependencies: [_RenderTheaterMarker], state: _OverlayPortalState#33702):
    'package:flutter/src/rendering/object.dart': Failed assertion: line 1982 pos 12: 'child.owner == owner': is not true.
    
    
    Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
    In either case, please report this assertion by filing a bug on GitHub:
      https://github.com/flutter/flutter/issues/new?template=02_bug.yml
    
    The relevant error-causing widget was: 
      Slider Slider:file:///Users/dhs/Downloads/overlay_portal_assertion%202/lib/main.dart:56:48
    When the exception was thrown, this was the stack: 
    #2      RenderObject.redepthChild (package:flutter/src/rendering/object.dart:1982:12)
    #3      _RenderDeferredLayoutBox.redepthChildren (package:flutter/src/widgets/overlay.dart:2426:22)
    #4      RenderObject.redepthChild (package:flutter/src/rendering/object.dart:1985:13)
    #5      RenderObject.adoptChild (package:flutter/src/rendering/object.dart:2036:5)
    #6      _RenderTheater._addDeferredChild (package:flutter/src/widgets/overlay.dart:1261:5)
    #7      _OverlayEntryLocation._addChild (package:flutter/src/widgets/overlay.dart:2066:14)
    #8      _OverlayPortalElement.insertRenderObjectChild (package:flutter/src/widgets/overlay.dart:2311:12)
    #9      RenderObjectElement.attachRenderObject (package:flutter/src/widgets/framework.dart:6844:35)
    #10     RenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6706:5)
    #11     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:7017:11)
    #12     Element.inflateWidget (package:flutter/src/widgets/framework.dart:4548:16)
    #13     Element.updateChild (package:flutter/src/widgets/framework.dart:4004:18)
    #14     _OverlayPortalElement.mount (package:flutter/src/widgets/overlay.dart:2248:21)
    ...     Normal element mounting (65 frames)
    #79     Element.inflateWidget (package:flutter/src/widgets/framework.dart:4548:16)
    #80     Element.updateChild (package:flutter/src/widgets/framework.dart:4004:18)
    #81     _OverlayPortalElement.mount (package:flutter/src/widgets/overlay.dart:2247:14)
    ...     Normal element mounting (17 frames)
    #98     Element.inflateWidget (package:flutter/src/widgets/framework.dart:4548:16)
    #99     _TableElement.mount.<anonymous closure>.<anonymous closure> (package:flutter/src/widgets/table.dart:303:26)
    #100    MappedListIterable.elementAt (dart:_internal/iterable.dart:442:31)
    #101    ListIterator.moveNext (dart:_internal/iterable.dart:371:26)
    #102    new _List._ofEfficientLengthIterable (dart:core-patch/array.dart:170:27)
    #103    new _List.of (dart:core-patch/array.dart:134:20)
    #104    new List.of (dart:core-patch/array_patch.dart:39:50)
    #105    ListIterable.toList (dart:_internal/iterable.dart:224:7)
    #106    _TableElement.mount.<anonymous closure> (package:flutter/src/widgets/table.dart:305:18)
    #107    MappedListIterable.elementAt (dart:_internal/iterable.dart:442:31)
    #108    ListIterator.moveNext (dart:_internal/iterable.dart:371:26)
    #109    new _List._ofEfficientLengthIterable (dart:core-patch/array.dart:170:27)
    #110    new _List.of (dart:core-patch/array.dart:134:20)
    #111    new List.of (dart:core-patch/array_patch.dart:39:50)
    #112    ListIterable.toList (dart:_internal/iterable.dart:224:7)
    #113    _TableElement.mount (package:flutter/src/widgets/table.dart:308:10)
    ...     Normal element mounting (25 frames)
    #138    Element.inflateWidget (package:flutter/src/widgets/framework.dart:4548:16)
    #139    MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:7169:36)
    #140    MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:7185:32)
    ...     Normal element mounting (340 frames)
    #480    Element.inflateWidget (package:flutter/src/widgets/framework.dart:4548:16)
    #481    MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:7169:36)
    #482    MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:7185:32)
    ...     Normal element mounting (533 frames)
    #1015   Element.inflateWidget (package:flutter/src/widgets/framework.dart:4548:16)
    #1016   Element.updateChild (package:flutter/src/widgets/framework.dart:4004:18)
    #1017   _RawViewElement._updateChild (package:flutter/src/widgets/view.dart:481:16)
    #1018   _RawViewElement.mount (package:flutter/src/widgets/view.dart:504:5)
    ...     Normal element mounting (15 frames)
    #1033   Element.inflateWidget (package:flutter/src/widgets/framework.dart:4548:16)
    #1034   Element.updateChild (package:flutter/src/widgets/framework.dart:4004:18)
    #1035   RootElement._rebuild (package:flutter/src/widgets/binding.dart:1716:16)
    #1036   RootElement.mount (package:flutter/src/widgets/binding.dart:1685:5)
    #1037   RootWidget.attach.<anonymous closure> (package:flutter/src/widgets/binding.dart:1638:18)
    #1038   BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:3046:19)
    #1039   RootWidget.attach (package:flutter/src/widgets/binding.dart:1637:13)
    #1040   WidgetsBinding.attachToBuildOwner (package:flutter/src/widgets/binding.dart:1376:27)
    #1041   WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:1361:5)
    #1042   WidgetsBinding.scheduleAttachRootWidget.<anonymous closure> (package:flutter/src/widgets/binding.dart:1347:7)
    #1046   _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:193:12)
    (elided 5 frames from class _AssertionError, class _Timer, and dart:async-patch)
    ====================================================================================================
    
    ======== Exception caught by widgets library =======================================================
    The following assertion was thrown building OverlayPortal(dependencies: [_RenderTheaterMarker], state: _OverlayPortalState#34002):
    'package:flutter/src/widgets/overlay.dart': Failed assertion: line 1259 pos 12: '!_skipMarkNeedsLayout': is not true.
    
    
    Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
    In either case, please report this assertion by filing a bug on GitHub:
      https://github.com/flutter/flutter/issues/new?template=02_bug.yml
    
    The relevant error-causing widget was: 
      Slider Slider:file:///Users/dhs/Downloads/overlay_portal_assertion%202/lib/main.dart:89:48
    When the exception was thrown, this was the stack: 
    #2      _RenderTheater._addDeferredChild (package:flutter/src/widgets/overlay.dart:1259:12)
    #3      _OverlayEntryLocation._addChild (package:flutter/src/widgets/overlay.dart:2066:14)
    #4      _OverlayPortalElement.insertRenderObjectChild (package:flutter/src/widgets/overlay.dart:2311:12)
    #5      RenderObjectElement.attachRenderObject (package:flutter/src/widgets/framework.dart:6844:35)
    #6      RenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6706:5)
    #7      SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:7017:11)
    #8      Element.inflateWidget (package:flutter/src/widgets/framework.dart:4548:16)
    #9      Element.updateChild (package:flutter/src/widgets/framework.dart:4004:18)
    #10     _OverlayPortalElement.mount (package:flutter/src/widgets/overlay.dart:2248:21)
    ...     Normal element mounting (65 frames)
    #75     Element.inflateWidget (package:flutter/src/widgets/framework.dart:4548:16)
    #76     Element.updateChild (package:flutter/src/widgets/framework.dart:4004:18)
    #77     _OverlayPortalElement.mount (package:flutter/src/widgets/overlay.dart:2247:14)
    ...     Normal element mounting (17 frames)
    #94     Element.inflateWidget (package:flutter/src/widgets/framework.dart:4548:16)
    #95     _TableElement.mount.<anonymous closure>.<anonymous closure> (package:flutter/src/widgets/table.dart:303:26)
    #96     MappedListIterable.elementAt (dart:_internal/iterable.dart:442:31)
    #97     ListIterator.moveNext (dart:_internal/iterable.dart:371:26)
    #98     new _List._ofEfficientLengthIterable (dart:core-patch/array.dart:170:27)
    #99     new _List.of (dart:core-patch/array.dart:134:20)
    #100    new List.of (dart:core-patch/array_patch.dart:39:50)
    #101    ListIterable.toList (dart:_internal/iterable.dart:224:7)
    #102    _TableElement.mount.<anonymous closure> (package:flutter/src/widgets/table.dart:305:18)
    #103    MappedListIterable.elementAt (dart:_internal/iterable.dart:442:31)
    #104    ListIterator.moveNext (dart:_internal/iterable.dart:371:26)
    #105    new _List._ofEfficientLengthIterable (dart:core-patch/array.dart:170:27)
    #106    new _List.of (dart:core-patch/array.dart:134:20)
    #107    new List.of (dart:core-patch/array_patch.dart:39:50)
    #108    ListIterable.toList (dart:_internal/iterable.dart:224:7)
    #109    _TableElement.mount (package:flutter/src/widgets/table.dart:308:10)
    ...     Normal element mounting (25 frames)
    #134    Element.inflateWidget (package:flutter/src/widgets/framework.dart:4548:16)
    #135    MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:7169:36)
    #136    MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:7185:32)
    ...     Normal element mounting (340 frames)
    #476    Element.inflateWidget (package:flutter/src/widgets/framework.dart:4548:16)
    #477    MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:7169:36)
    #478    MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:7185:32)
    ...     Normal element mounting (533 frames)
    #1011   Element.inflateWidget (package:flutter/src/widgets/framework.dart:4548:16)
    #1012   Element.updateChild (package:flutter/src/widgets/framework.dart:4004:18)
    #1013   _RawViewElement._updateChild (package:flutter/src/widgets/view.dart:481:16)
    #1014   _RawViewElement.mount (package:flutter/src/widgets/view.dart:504:5)
    ...     Normal element mounting (15 frames)
    #1029   Element.inflateWidget (package:flutter/src/widgets/framework.dart:4548:16)
    #1030   Element.updateChild (package:flutter/src/widgets/framework.dart:4004:18)
    #1031   RootElement._rebuild (package:flutter/src/widgets/binding.dart:1716:16)
    #1032   RootElement.mount (package:flutter/src/widgets/binding.dart:1685:5)
    #1033   RootWidget.attach.<anonymous closure> (package:flutter/src/widgets/binding.dart:1638:18)
    #1034   BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:3046:19)
    #1035   RootWidget.attach (package:flutter/src/widgets/binding.dart:1637:13)
    #1036   WidgetsBinding.attachToBuildOwner (package:flutter/src/widgets/binding.dart:1376:27)
    #1037   WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:1361:5)
    #1038   WidgetsBinding.scheduleAttachRootWidget.<anonymous closure> (package:flutter/src/widgets/binding.dart:1347:7)
    #1042   _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:193:12)
    (elided 5 frames from class _AssertionError, class _Timer, and dart:async-patch)
    ====================================================================================================
    
    ======== Exception caught by rendering library =====================================================
    The following assertion was thrown during performLayout():
    A _RenderDeferredLayoutBox was mutated in _RenderTheater.performLayout.
    
    The RenderObject was mutated when none of its ancestors is actively performing layout.
    The RenderObject being mutated was: _RenderDeferredLayoutBox#12963 NEEDS-PAINT
      parentData: not positioned; offset=Offset(0.0, 0.0)
      constraints: BoxConstraints(w=448.0, h=997.3)
      size: Size(448.0, 997.3)
    The RenderObject that was mutating the said _RenderDeferredLayoutBox was: _RenderTheater#84a90 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
      parentData: <none> (can use size)
      constraints: BoxConstraints(w=448.0, h=997.3)
      size: Size(448.0, 997.3)
      skipCount: 0
      textDirection: ltr
    The relevant error-causing widget was: 
      MaterialApp MaterialApp:file:///Users/dhs/Downloads/overlay_portal_assertion%202/lib/main.dart:12:12
    When the exception was thrown, this was the stack: 
    #0      RenderObject._debugCanPerformMutations.<anonymous closure> (package:flutter/src/rendering/object.dart:2217:9)
    #1      RenderObject._debugCanPerformMutations (package:flutter/src/rendering/object.dart:2283:6)
    #2      RenderObject.markNeedsLayout (package:flutter/src/rendering/object.dart:2516:12)
    #3      RenderBox.markNeedsLayout (package:flutter/src/rendering/box.dart:2859:11)
    #4      _RenderDeferredLayoutBox.markNeedsLayout (package:flutter/src/widgets/overlay.dart:2442:11)
    #5      _RenderDeferredLayoutBox._doLayoutFrom.<anonymous closure> (package:flutter/src/widgets/overlay.dart:2497:9)
    #6      RenderObject.invokeLayoutCallback.<anonymous closure> (package:flutter/src/rendering/object.dart:2881:17)
    #7      PipelineOwner._enableMutationsToDirtySubtrees (package:flutter/src/rendering/object.dart:1206:15)
    #8      RenderObject.invokeLayoutCallback (package:flutter/src/rendering/object.dart:2880:14)
    #9      _RenderDeferredLayoutBox._doLayoutFrom (package:flutter/src/widgets/overlay.dart:2496:22)
    #10     _RenderDeferredLayoutBox.layout (package:flutter/src/widgets/overlay.dart:2506:5)
    #11     _RenderTheaterMixin.layoutChild (package:flutter/src/widgets/overlay.dart:1085:13)
    #12     _RenderTheater.performLayout (package:flutter/src/widgets/overlay.dart:1430:9)
    #13     RenderObject.layout (package:flutter/src/rendering/object.dart:2762:7)
    #14     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:115:18)
    #15     RenderObject.layout (package:flutter/src/rendering/object.dart:2762:7)
    #16     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:115:18)
    #17     RenderObject.layout (package:flutter/src/rendering/object.dart:2762:7)
    #18     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:115:18)
    #19     RenderObject.layout (package:flutter/src/rendering/object.dart:2762:7)
    #20     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:115:18)
    #21     RenderCustomPaint.performLayout (package:flutter/src/rendering/custom_paint.dart:574:11)
    #22     RenderObject.layout (package:flutter/src/rendering/object.dart:2762:7)
    #23     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:115:18)
    #24     RenderObject.layout (package:flutter/src/rendering/object.dart:2762:7)
    #25     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:115:18)
    #26     RenderObject.layout (package:flutter/src/rendering/object.dart:2762:7)
    #27     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:115:18)
    #28     RenderObject.layout (package:flutter/src/rendering/object.dart:2762:7)
    #29     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:115:18)
    #30     RenderObject.layout (package:flutter/src/rendering/object.dart:2762:7)
    #31     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:115:18)
    #32     RenderObject.layout (package:flutter/src/rendering/object.dart:2762:7)
    #33     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:115:18)
    #34     RenderObject.layout (package:flutter/src/rendering/object.dart:2762:7)
    #35     RenderView.performLayout (package:flutter/src/rendering/view.dart:294:12)
    #36     RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:2610:7)
    #37     PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:1157:18)
    #38     PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:1170:15)
    #39     RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:629:23)
    #40     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:1261:13)
    #41     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:495:5)
    #42     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1434:15)
    #43     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1347:9)
    #44     SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:1057:9)
    #45     PlatformDispatcher.scheduleWarmUpFrame.<anonymous closure> (dart:ui/platform_dispatcher.dart:886:16)
    #49     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:193:12)
    (elided 3 frames from class _Timer and dart:async-patch)
    The following RenderObject was being processed when the exception was fired: _RenderTheater#84a90 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
    ...  parentData: <none> (can use size)
    ...  constraints: BoxConstraints(w=448.0, h=997.3)
    ...  size: Size(448.0, 997.3)
    ...  skipCount: 0
    ...  textDirection: ltr
    RenderObject: _RenderTheater#84a90 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
      parentData: <none> (can use size)
      constraints: BoxConstraints(w=448.0, h=997.3)
      size: Size(448.0, 997.3)
      skipCount: 0
      textDirection: ltr
    ...  onstage 1: RenderIgnorePointer#32598 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
    ...    parentData: not positioned; offset=Offset(0.0, 0.0) (can use size)
    ...    constraints: BoxConstraints(w=448.0, h=997.3)
    ...    size: Size(448.0, 997.3)
    ...    ignoring: false
    ...    ignoringSemantics: null
    ...    child: RenderBlockSemantics#704c1 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
    ...      parentData: <none> (can use size)
    ...      constraints: BoxConstraints(w=448.0, h=997.3)
    ...      blocks semantics of earlier render objects below the common boundary
    ...      size: Size(448.0, 997.3)
    ...      blocking: true
    ...      child: RenderExcludeSemantics#dc960 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
    ...        parentData: <none> (can use size)
    ...        constraints: BoxConstraints(w=448.0, h=997.3)
    ...        size: Size(448.0, 997.3)
    ...        excluding: true
    ...        child: RenderSemanticsGestureHandler#075e1 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
    ...          parentData: <none> (can use size)
    ...          constraints: BoxConstraints(w=448.0, h=997.3)
    ...          size: Size(448.0, 997.3)
    ...          behavior: opaque
    ...          gestures: <none>
    ...  onstage 2: RenderSemanticsAnnotations#acf99 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
    ...    parentData: not positioned; offset=Offset(0.0, 0.0) (can use size)
    ...    constraints: BoxConstraints(w=448.0, h=997.3)
    ...    size: Size(448.0, 997.3)
    ...    child: RenderOffstage#befef NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
    ...      parentData: <none> (can use size)
    ...      constraints: BoxConstraints(w=448.0, h=997.3)
    ...      size: Size(448.0, 997.3)
    ...      offstage: false
    ...      child: RenderSemanticsAnnotations#0d706 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
    ...        parentData: <none> (can use size)
    ...        constraints: BoxConstraints(w=448.0, h=997.3)
    ...        size: Size(448.0, 997.3)
    ...        child: RenderRepaintBoundary#a7ed7 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
    ...          needs compositing
    ...          parentData: <none> (can use size)
    ...          constraints: BoxConstraints(w=448.0, h=997.3)
    ...          size: Size(448.0, 997.3)
    ...          usefulness ratio: no metrics collected yet (never painted)
    ...  onstage 2 - 1: _RenderDeferredLayoutBox#12963 NEEDS-PAINT
    ...    parentData: not positioned; offset=Offset(0.0, 0.0)
    ...    constraints: BoxConstraints(w=448.0, h=997.3)
    ...    size: Size(448.0, 997.3)
    ...  onstage 2 - 2: _RenderDeferredLayoutBox#803a5 NEEDS-LAYOUT NEEDS-PAINT DETACHED
    ...    parentData: MISSING
    ...    constraints: MISSING
    ...    size: MISSING
    ...  no offstage children
    ====================================================================================================
    
    ======== Exception caught by rendering library =====================================================
    The following _TypeError was thrown during paint():
    Null check operator used on a null value
    
    The relevant error-causing widget was: 
      MaterialApp MaterialApp:file:///Users/dhs/Downloads/overlay_portal_assertion%202/lib/main.dart:12:12
    When the exception was thrown, this was the stack: 
    #0      _RenderTheaterMixin.paint (package:flutter/src/widgets/overlay.dart:1119:63)
    #1      _RenderTheater.paint (package:flutter/src/widgets/overlay.dart:1477:13)
    #2      RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3423:7)
    #3      PaintingContext.paintChild (package:flutter/src/rendering/object.dart:261:13)
    #4      RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:13)
    #5      RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3423:7)
    #6      PaintingContext.paintChild (package:flutter/src/rendering/object.dart:261:13)
    #7      RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:13)
    #8      RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3423:7)
    #9      PaintingContext.paintChild (package:flutter/src/rendering/object.dart:261:13)
    #10     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:13)
    #11     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3423:7)
    #12     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:261:13)
    #13     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:13)
    #14     RenderCustomPaint.paint (package:flutter/src/rendering/custom_paint.dart:644:11)
    #15     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3423:7)
    #16     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:261:13)
    #17     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:13)
    #18     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3423:7)
    #19     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:261:13)
    #20     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:13)
    #21     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3423:7)
    #22     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:261:13)
    #23     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:13)
    #24     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3423:7)
    #25     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:261:13)
    #26     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:13)
    #27     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3423:7)
    #28     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:261:13)
    #29     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:13)
    #30     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3423:7)
    #31     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:261:13)
    #32     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:13)
    #33     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3423:7)
    #34     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:261:13)
    #35     RenderView.paint (package:flutter/src/rendering/view.dart:322:15)
    #36     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3423:7)
    #37     PaintingContext._repaintCompositedChild (package:flutter/src/rendering/object.dart:176:11)
    #38     PaintingContext.repaintCompositedChild (package:flutter/src/rendering/object.dart:121:5)
    #39     PipelineOwner.flushPaint (package:flutter/src/rendering/object.dart:1309:31)
    #40     PipelineOwner.flushPaint (package:flutter/src/rendering/object.dart:1319:15)
    #41     RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:631:23)
    #42     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:1261:13)
    #43     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:495:5)
    #44     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1434:15)
    #45     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1347:9)
    #46     SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:1057:9)
    #47     PlatformDispatcher.scheduleWarmUpFrame.<anonymous closure> (dart:ui/platform_dispatcher.dart:886:16)
    #51     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:193:12)
    (elided 3 frames from class _Timer and dart:async-patch)
    The following RenderObject was being processed when the exception was fired: _RenderTheater#84a90
    ...  needs compositing
    ...  parentData: <none> (can use size)
    ...  constraints: BoxConstraints(w=448.0, h=997.3)
    ...  size: Size(448.0, 997.3)
    ...  skipCount: 0
    ...  textDirection: ltr
    RenderObject: _RenderTheater#84a90
      needs compositing
      parentData: <none> (can use size)
      constraints: BoxConstraints(w=448.0, h=997.3)
      size: Size(448.0, 997.3)
      skipCount: 0
      textDirection: ltr
    ...  onstage 1: RenderIgnorePointer#32598
    ...    parentData: not positioned; offset=Offset(0.0, 0.0) (can use size)
    ...    constraints: BoxConstraints(w=448.0, h=997.3)
    ...    size: Size(448.0, 997.3)
    ...    ignoring: false
    ...    ignoringSemantics: null
    ...    child: RenderBlockSemantics#704c1
    ...      parentData: <none> (can use size)
    ...      constraints: BoxConstraints(w=448.0, h=997.3)
    ...      blocks semantics of earlier render objects below the common boundary
    ...      size: Size(448.0, 997.3)
    ...      blocking: true
    ...      child: RenderExcludeSemantics#dc960
    ...        parentData: <none> (can use size)
    ...        constraints: BoxConstraints(w=448.0, h=997.3)
    ...        size: Size(448.0, 997.3)
    ...        excluding: true
    ...        child: RenderSemanticsGestureHandler#075e1
    ...          parentData: <none> (can use size)
    ...          constraints: BoxConstraints(w=448.0, h=997.3)
    ...          size: Size(448.0, 997.3)
    ...          behavior: opaque
    ...          gestures: <none>
    ...  onstage 2: RenderSemanticsAnnotations#acf99
    ...    needs compositing
    ...    parentData: not positioned; offset=Offset(0.0, 0.0) (can use size)
    ...    constraints: BoxConstraints(w=448.0, h=997.3)
    ...    size: Size(448.0, 997.3)
    ...    child: RenderOffstage#befef
    ...      needs compositing
    ...      parentData: <none> (can use size)
    ...      constraints: BoxConstraints(w=448.0, h=997.3)
    ...      size: Size(448.0, 997.3)
    ...      offstage: false
    ...      child: RenderSemanticsAnnotations#0d706
    ...        needs compositing
    ...        parentData: <none> (can use size)
    ...        constraints: BoxConstraints(w=448.0, h=997.3)
    ...        size: Size(448.0, 997.3)
    ...        child: RenderRepaintBoundary#a7ed7
    ...          needs compositing
    ...          parentData: <none> (can use size)
    ...          constraints: BoxConstraints(w=448.0, h=997.3)
    ...          layer: OffsetLayer#66c80
    ...            handles: 2
    ...            offset: Offset(0.0, 0.0)
    ...          size: Size(448.0, 997.3)
    ...          metrics: 0.0% useful (1 bad vs 0 good)
    ...          diagnosis: insufficient data to draw conclusion (less than five repaints)
    ...  onstage 2 - 1: _RenderDeferredLayoutBox#12963
    ...    parentData: not positioned; offset=Offset(0.0, 0.0)
    ...    constraints: BoxConstraints(w=448.0, h=997.3)
    ...    size: Size(448.0, 997.3)
    ...  onstage 2 - 2: _RenderDeferredLayoutBox#803a5 NEEDS-LAYOUT NEEDS-PAINT DETACHED
    ...    parentData: MISSING
    ...    constraints: MISSING
    ...    size: MISSING
    ...  no offstage children
    ====================================================================================================
    I/Choreographer( 8945): Skipped 151 frames!  The application may be doing too much work on its main thread.
    D/ProfileInstaller( 8945): Installing profile for com.example.overlay_portal_assertion
    I/ortal_assertion( 8945): Background concurrent mark compact GC freed 2475KB AllocSpace bytes, 3(60KB) LOS objects, 49% free, 2492KB/4984KB, paused 181us,1.943ms total 149.103ms
    
    
    runnable code
    
    import 'package:flutter/material.dart';
    
    void main() {
      runApp(MainApp());
    }
    
    class MainApp extends StatelessWidget {
      const MainApp({super.key});
    
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          home: MainPage(),
        );
      }
    }
    
    class MainPage extends StatefulWidget {
      const MainPage({super.key});
    
      static const sliderValuesMin = -100;
      static const sliderValuesMax = 100;
      static const sliderValuesNumberOfSteps = 100;
      static const sliderValuesStep =
          (sliderValuesMax - sliderValuesMin) / sliderValuesNumberOfSteps;
      static const sliderValuesInit = 0;
    
      @override
      State<MainPage> createState() => _MainPageState();
    }
    
    class _MainPageState extends State<MainPage> {
      final _value1 = ValueNotifier<num>(MainPage.sliderValuesInit);
      final _value2 = ValueNotifier<num>(MainPage.sliderValuesInit);
    
      @override
      Widget build(BuildContext context) {
        final commonValueMin = MainPage.sliderValuesMin.toDouble();
        final commonValueMax = MainPage.sliderValuesMax.toDouble();
        final commonNumValueDivisions = MainPage.sliderValuesNumberOfSteps;
        final largestWidthOfValues = determineWidthOfText('-www', context);
    
        return Scaffold(
          body: Table(
            defaultColumnWidth: IntrinsicColumnWidth(),
            defaultVerticalAlignment: TableCellVerticalAlignment.middle,
            columnWidths: {1: FlexColumnWidth()},
            children: [
              TableRow(
                children: [
                  Text('Value 1:', textAlign: TextAlign.right),
                  Tooltip(
                    message: "Value 1 setting",
                    child: ListenableBuilder(
                      listenable: _value1,
                      builder: (context, child) => Slider(
                        value: _value1.value.toDouble(),
                        onChanged: null,
                        min: commonValueMin,
                        max: commonValueMax,
                        divisions: commonNumValueDivisions,
                      ),
                    ),
                  ),
                  ListenableBuilder(
                    listenable: _value1,
                    builder: (context, child) => ConstrainedBox(
                      constraints: BoxConstraints(minWidth: largestWidthOfValues),
                      child: Text(
                        _value1.value.toStringAsFixed(0),
                        textAlign: TextAlign.right,
                      ),
                    ),
                  ),
                  Container(width: 8),
                  IconButton(
                    onPressed: null,
                    icon: const Icon(Icons.exposure_zero_sharp),
                    tooltip: "Reset value 1",
                  ),
                ],
              ),
              TableRow(
                children: [
                  Text('Value 2:', textAlign: TextAlign.right),
                  Tooltip(
                    child: ListenableBuilder(
                      listenable: _value2,
                      builder: (context, child) => Slider(
                        value: _value2.value.toDouble(),
                        onChanged: null,
                        min: commonValueMin,
                        max: commonValueMax,
                        divisions: commonNumValueDivisions,
                      ),
                    ),
                    message: "Value 2 setting",
                  ),
                  ListenableBuilder(
                    listenable: _value2,
                    builder: (context, child) => ConstrainedBox(
                      constraints: BoxConstraints(minWidth: largestWidthOfValues),
                      child: Text(
                        _value2.value.toStringAsFixed(0),
                        textAlign: TextAlign.end,
                      ),
                    ),
                  ),
                  Container(width: 8),
                  IconButton(
                    onPressed: null,
                    icon: const Icon(Icons.exposure_zero_sharp),
                    tooltip: "Reset value 2",
                  ),
                ],
              ),
            ],
          ),
        );
      }
    }
    
    double determineWidthOfText(final String text, BuildContext context) {
      final textSpan = TextSpan(text: text);
      final textPainter = TextPainter(
        text: textSpan,
        textDirection: Directionality.of(context),
        maxLines: 1,
      );
      textPainter.layout();
      return textPainter.width;
    }
    
    
    stable : 3.35.1
    master : 3.36.0-1.0.pre-211
    
  7. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    a: error messageError messages from the Flutter framework
    c: crashStack traces logged to the console
    c: regressionIt was better in the past than it is now
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    on Aug 22, 2025
  8. 28 remaining items

  9. idipak commented on Mar 4, 2026

    @idipak

    This works

    import 'package:flutter/material.dart';
    
    void main() => runApp(const MyApp());
    
    class MyApp extends StatelessWidget {
      const MyApp({super.key});
    
      @override
      Widget build(BuildContext context) => MaterialApp(
        home: Scaffold(
          body: Table(
            children: [
              TableRow(
                children: [
                  FutureBuilder(
                    future: Future.delayed(Duration.zero),
                    builder: (context, snapshot) {
                      if (snapshot.connectionState == ConnectionState.done) {
                        return Slider(value: 0, onChanged: (_) => UnimplementedError());
                      }
                      return const SizedBox.shrink();
                    },
                  ),
                ],
              ),
            ],
          ),
        ),
      );
    }
    
  10. TB-StarcMed commented on Mar 5, 2026

    @TB-StarcMed
    Author

    This works

    import 'package:flutter/material.dart';
    
    void main() => runApp(const MyApp());
    
    class MyApp extends StatelessWidget {
      const MyApp({super.key});
    
      @override
      Widget build(BuildContext context) => MaterialApp(
        home: Scaffold(
          body: Table(
            children: [
              TableRow(
                children: [
                  FutureBuilder(
                    future: Future.delayed(Duration.zero),
                    builder: (context, snapshot) {
                      if (snapshot.connectionState == ConnectionState.done) {
                        return Slider(value: 0, onChanged: (_) => UnimplementedError());
                      }
                      return const SizedBox.shrink();
                    },
                  ),
                ],
              ),
            ],
          ),
        ),
      );
    }
    

    This is just a workaround. Normally, the Slider component should work without such a workaround in a table. The Flutter developers need to decide how to fix this issue. I am more or less just a user. At the moment, I am using a structure consisting of Column (Partially with crossAxisAlignment = CrossAxisAlignment.stretch), IntrinsicWidth and ConstrainedBox components, that set each a minimum width that is determined by calculating a maximum width vaue for the texts that the surrounding Text components have at max using TextSpan and TextPainter class instances, instead of using a table for the part that contains the sliders.

  11. idipak commented on Mar 5, 2026

    @idipak

    This works

    import 'package:flutter/material.dart';
    
    void main() => runApp(const MyApp());
    
    class MyApp extends StatelessWidget {
      const MyApp({super.key});
    
      @override
      Widget build(BuildContext context) => MaterialApp(
        home: Scaffold(
          body: Table(
            children: [
              TableRow(
                children: [
                  FutureBuilder(
                    future: Future.delayed(Duration.zero),
                    builder: (context, snapshot) {
                      if (snapshot.connectionState == ConnectionState.done) {
                        return Slider(value: 0, onChanged: (_) => UnimplementedError());
                      }
                      return const SizedBox.shrink();
                    },
                  ),
                ],
              ),
            ],
          ),
        ),
      );
    }
    

    This is just a workaround. Normally, the Slider component should work without such a workaround in a table. The Flutter developers need to decide how to fix this issue. I am more or less just a user. At the moment, I am using a structure consisting of Column (Partially with crossAxisAlignment = CrossAxisAlignment.stretch), IntrinsicWidth and ConstrainedBox components, that set each a minimum width that is determined by calculating a maximum width vaue for the texts that the surrounding Text components have at max using TextSpan and TextPainter class instances, instead of using a table for the part that contains the sliders.

    I know this is not a fix, I have just posted a work around for those who are blocked.

  12. added 5 commits that reference this issue on May 1, 2026
    625854c
    68d004d
    5adb390
    d2d8d37
    df885bd
  13. added a commit that references this issue on May 21, 2026
    f9af233
  14. added a commit that references this issue on May 23, 2026
    1ce6518
  15. added a commit that references this issue on Jun 26, 2026
    263bc45
  16. github-actions commented on Jul 14, 2026

    @github-actions

    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.

  17. locked as resolved and limited conversation to collaborators on Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: error messageError messages from the Flutter frameworkc: crashStack traces logged to the consolec: regressionIt was better in the past than it is nowfound in release: 3.35Found to occur in 3.35found in release: 3.36Found to occur in 3.36frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions