Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed extent lists cannot handle infinite container extent #8398

Closed
Reagankm opened this issue Feb 24, 2017 · 3 comments · Fixed by #8885
Closed

Fixed extent lists cannot handle infinite container extent #8398

Reagankm opened this issue Feb 24, 2017 · 3 comments · Fixed by #8885
Assignees
Labels
c: crash Stack traces logged to the console f: scrolling Viewports, list views, slivers, etc.

Comments

@Reagankm
Copy link
Contributor

Steps to Reproduce

I have a build function like this:

Widget build(BuildContext context) {
    return new Scaffold(
      key: _key,
      appBar: new AppBar(title: new Text(appBarTitle)),
      body: new ListView(
        children: [
          _thingOne(),
          _thingTwo(),
          new Container(
            padding: new EdgeInsets.symmetric(
              vertical: style.wideMargin, horizontal: style.defaultMargin),
            child: new Card(
              child: new ListView(
                 itemExtent: kListItemExtent[MaterialListType.oneLine],
                 children: _subItems,
                 shrinkWrap: true,
             ),),),],),);
  }

When the ItemExtent is set, I get a render error. It also happens if I set it to some literal double (rather than using kListItemExtent) and it doesn't happen if I use itemExtent on the outer ListView. Maybe this is just something I'm not understanding about what itemExtent is meant to do, but wanted to let you know.

Logs

This is the stack trace:
I/flutter (28403): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter (28403): The following UnsupportedError was thrown during performLayout():
I/flutter (28403): Unsupported operation: Infinity or NaN toInt
I/flutter (28403):
I/flutter (28403): When the exception was thrown, this was the stack:
I/flutter (28403): #0 double.toInt (dart:core-patch/double.dart:136)
I/flutter (28403): #1 double.ceil (dart:core-patch/double.dart:111)
I/flutter (28403): #2 RenderSliverFixedExtentBoxAdaptor.performLayout (package:flutter/src/rendering/sliver_fixed_extent_list.dart:41:101)
I/flutter (28403): #3 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #4 RenderViewportBase.layoutOneSide (package:flutter/src/rendering/sliver.dart:1319:13)
I/flutter (28403): #5 RenderShrinkWrappingViewport._attemptLayout (package:flutter/src/rendering/sliver.dart:2072:12)
I/flutter (28403): #6 RenderShrinkWrappingViewport.performLayout (package:flutter/src/rendering/sliver.dart:2035:20)
I/flutter (28403): #7 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #8 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #9 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #10 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #11 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #12 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #13 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #14 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #15 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #16 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #17 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #18 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #19 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #20 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #21 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #22 RenderSliverList.performLayout.advance (package:flutter/src/rendering/sliver_list.dart:137:17)
I/flutter (28403): #23 RenderSliverList.performLayout (package:flutter/src/rendering/sliver_list.dart:170:19)
I/flutter (28403): #24 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #25 RenderViewportBase.layoutOneSide (package:flutter/src/rendering/sliver.dart:1319:13)
I/flutter (28403): #26 RenderViewport._attemptLayout (package:flutter/src/rendering/sliver.dart:1808:12)
I/flutter (28403): #27 RenderViewport.performLayout (package:flutter/src/rendering/sliver.dart:1737:20)
I/flutter (28403): #28 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #29 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #30 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #31 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #32 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #33 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #34 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #35 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #36 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #37 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #38 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #39 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #40 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #41 MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:124:11)
I/flutter (28403): #42 _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:86:7)
I/flutter (28403): #43 MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:194:7)
I/flutter (28403): #44 RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:338:14)
I/flutter (28403): #45 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #46 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #47 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #48 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #49 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #50 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #51 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #52 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #53 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #54 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #55 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #56 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #57 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #58 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #59 RenderOffstage.performLayout (package:flutter/src/rendering/proxy_box.dart:2352:26)
I/flutter (28403): #60 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #61 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #62 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #63 RenderStack.performLayout (package:flutter/src/rendering/stack.dart:354:15)
I/flutter (28403): #64 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #65 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #66 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #67 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #68 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #69 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #70 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #71 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #72 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #73 RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:100:13)
I/flutter (28403): #74 RenderObject.layout (package:flutter/src/rendering/object.dart:1742:7)
I/flutter (28403): #75 RenderView.performLayout (package:flutter/src/rendering/view.dart:114:13)
I/flutter (28403): #76 RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1618:7)
I/flutter (28403): #77 PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:953:18)
I/flutter (28403): #78 BindingBase&SchedulerBinding&GestureBinding&ServicesBinding&RendererBinding.beginFrame (package:flutter/src/rendering/binding.dart:225:19)
I/flutter (28403): #79 BindingBase&SchedulerBinding&GestureBinding&ServicesBinding&RendererBinding&WidgetsBinding.beginFrame (package:flutter/src/widgets/binding.dart:333:23)
I/flutter (28403): #80 BindingBase&SchedulerBinding&GestureBinding&ServicesBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:170:5)
I/flutter (28403): #81 BindingBase&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:676:15)
I/flutter (28403): #82 BindingBase&SchedulerBinding.handleBeginFrame (package:flutter/src/scheduler/binding.dart:611:9)
I/flutter (28403): #83 BindingBase&SchedulerBinding&GestureBinding&ServicesBinding&RendererBinding.reassembleApplication (package:flutter/src/rendering/binding.dart:241:5)
I/flutter (28403):
I/flutter (28403): #84 BindingBase&SchedulerBinding&GestureBinding&ServicesBinding&RendererBinding&WidgetsBinding.reassembleApplication (package:flutter/src/widgets/binding.dart:381:39)
I/flutter (28403): #85 BindingBase.registerSignalServiceExtension. (package:flutter/src/foundation/binding.dart:182)
I/flutter (28403):
I/flutter (28403): #86 BindingBase.registerServiceExtension. (package:flutter/src/foundation/binding.dart:302)
I/flutter (28403):
I/flutter (28403): #87 _runExtension (dart:developer-patch/developer.dart:79)
I/flutter (28403):
I/flutter (28403): The following RenderObject was being processed when the exception was fired:
I/flutter (28403): RenderSliverFixedExtentList#856238102 relayoutBoundary=up10 NEEDS-LAYOUT
I/flutter (28403): creator: SliverFixedExtentList ← ShrinkWrappingViewport ← IgnorePointer-[GlobalKey#228812839] ←
I/flutter (28403): Listener ← _GestureSemantics ←
I/flutter (28403): RawGestureDetector-[LabeledGlobalKey#160728607] ← RepaintBoundary ←
I/flutter (28403): CustomPaint ← RepaintBoundary ← NotificationListener ←
I/flutter (28403): GlowingOverscrollIndicator ← Scrollable ← ⋯
I/flutter (28403): parentData: layoutOffset=0.0
I/flutter (28403): constraints: SliverConstraints(AxisDirection.down, GrowthDirection.forward, ScrollDirection.idle,
I/flutter (28403): scrollOffset: 0.0, remainingPaintExtent: Infinity, crossAxisExtent: 411.4viewportMainAxisExtent:
I/flutter (28403): Infinity)
I/flutter (28403): geometry: null
I/flutter (28403): no children current live
I/flutter (28403): This RenderObject has no descendants.
I/flutter (28403):
I/flutter (28403): ════════════════════════════════════════════════════════════════════════════════════════════════════
I/flutter (28403): Another exception was thrown: NoSuchMethodError: The getter 'debugAssertIsValid' was called on null.
I/flutter (28403): Another exception was thrown: 'package:flutter/src/rendering/box.dart': Failed assertion: line 1353 pos 12: 'hasSize': is not true.
I/flutter (28403): Another exception was thrown: 'package:flutter/src/rendering/box.dart': Failed assertion: line 1353 pos 12: 'hasSize': is not true.
I/flutter (28403): Another exception was thrown: 'package:flutter/src/rendering/box.dart': Failed assertion: line 1353 pos 12: 'hasSize': is not true.
I/flutter (28403): Another exception was thrown: 'package:flutter/src/rendering/box.dart': Failed assertion: line 1353 pos 12: 'hasSize': is not true.
I/flutter (28403): Another exception was thrown: 'package:flutter/src/rendering/box.dart': Failed assertion: line 1353 pos 12: 'hasSize': is not true.
I/flutter (28403): Another exception was thrown: 'package:flutter/src/rendering/box.dart': Failed assertion: line 1353 pos 12: 'hasSize': is not true.
I/flutter (28403): Another exception was thrown: 'package:flutter/src/rendering/box.dart': Failed assertion: line 1353 pos 12: 'hasSize': is not true.
I/flutter (28403): Another exception was thrown: 'package:flutter/src/rendering/box.dart': Failed assertion: line 1353 pos 12: 'hasSize': is not true.

Flutter Doctor

[✓] Flutter (on Linux, channel unknown)
• Flutter at /google/obj/workspace/516571f21de7a2bc9ecc59280a472bce/a0542bad-4ec0-4473-b052-7bf77832da71/blaze-out/gcc-4.X.Y-crosstool-v18-hybrid-grtev4-k8-fastbuild/bin/mobile/flutter/tools/doctor.runfiles/google3/mobile
• Framework revision (),
• Engine revision
• Tools Dart version 1.22.0-dev.10.6+google3-v1.22.0.dev.10.6

[✓] Android toolchain - develop for Android devices (Android SDK 25.0.2)
• Android SDK at /usr/local/google/home/arkham/Android/Sdk
• Platform android-25, build-tools 25.0.2
• OpenJDK Runtime Environment (build 1.8.0_112-google-v7-146844476-143772575)

[✓] Android Studio (version WithBlaze2.2)
• Android Studio at /opt/android-studio-with-blaze-2.2
• Gradle version 2.14.1

[-] IntelliJ IDEA Community Edition (version 2016.2)
• Dart plugin not installed; this adds Dart specific functionality.
• Flutter plugin not installed; this adds Flutter specific functionality.
• For information about managing plugins, see
https://www.jetbrains.com/help/idea/managing-plugins.html

[✓] IntelliJ IDEA Ultimate Edition (version 2016.2)
• Dart plugin version 162.2485
• Flutter plugin version 0.1.5

Device emulator-5554 is offline.
[✓] Connected devices
• Android SDK built for x86 • emulator-5556 • android-x86 • Android 7.0 (API 24) (emulator)
• Nexus 5X • 00e6cfc012b1c2ec • android-arm • Android 7.1.1 (API 25)

@abarth abarth self-assigned this Feb 24, 2017
@abarth abarth added c: crash Stack traces logged to the console f: scrolling Viewports, list views, slivers, etc. labels Feb 24, 2017
@abarth
Copy link
Contributor

abarth commented Feb 24, 2017

Thanks. I'll take a look.

@Hixie Hixie added this to the 3: Make conferences happy milestone Feb 28, 2017
@abarth
Copy link
Contributor

abarth commented Mar 20, 2017

I have a fix.

abarth added a commit to abarth/flutter that referenced this issue Mar 20, 2017
Previously they tried to compute an integer target end index, but
integers can't represent infinity. Now we use null to represent
infinity.

Also, fix some similar issues with grids.

Fixes flutter#8398
@abarth abarth changed the title Setting nested ListView's itemExtent causes a render error Fixed extent lists cannot handle infinite container extent Mar 20, 2017
abarth added a commit that referenced this issue Mar 20, 2017
Previously they tried to compute an integer target end index, but
integers can't represent infinity. Now we use null to represent
infinity.

Also, fix some similar issues with grids.

Fixes #8398
@github-actions
Copy link

github-actions bot commented Sep 5, 2021

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: crash Stack traces logged to the console f: scrolling Viewports, list views, slivers, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants