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

Sometimes i am getting Argument Error while scrolling. This is very random. #2

Open
varunn12 opened this issue Jul 2, 2018 · 1 comment

Comments

@varunn12
Copy link

varunn12 commented Jul 2, 2018

Launching lib\main.dart on LG H870DS in debug mode...
Built build\app\outputs\apk\debug\app-debug.apk.
I/FlutterActivityDelegate(11768): onResume setting current activity to this
I/ViewRootImpl(11768): ViewRoot's Touch Event : ACTION_DOWN
D/BezellessGripSuppressionFilter(11768): Filter[0] Ignore
D/BezellessGripSuppressionFilter(11768): mMiddleGripMask[0]
I/ViewRootImpl(11768): ViewRoot's Touch Event : ACTION_UP
I/ViewRootImpl(11768): ViewRoot's Touch Event : ACTION_DOWN
D/BezellessGripSuppressionFilter(11768): Filter[1] Ignore
D/BezellessGripSuppressionFilter(11768): mMiddleGripMask[1]
I/ViewRootImpl(11768): ViewRoot's Touch Event : ACTION_UP
I/ViewRootImpl(11768): ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl(11768): ViewRoot's Touch Event : ACTION_UP
I/ViewRootImpl(11768): ViewRoot's KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_BACK, scanCode=0, metaState=0, flags=0x48, repeatCount=0, eventTime=112724507, downTime=112724507, deviceId=-1, source=0x101 } to DecorView@2e485f1[MainActivity]
I/ViewRootImpl(11768): ViewRoot's KeyEvent { action=ACTION_UP, keyCode=KEYCODE_BACK, scanCode=0, metaState=0, flags=0x48, repeatCount=0, eventTime=112724581, downTime=112724507, deviceId=-1, source=0x101 } to DecorView@2e485f1[MainActivity]
I/ViewRootImpl(11768): ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl(11768): ViewRoot's Touch Event : ACTION_UP
I/flutter (11768): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter (11768): The following ArgumentError was thrown during performLayout():
I/flutter (11768): Invalid argument(s)
I/flutter (11768):
I/flutter (11768): When the exception was thrown, this was the stack:
I/flutter (11768): #0 _StringBase.+ (dart:core/runtime/libstring_patch.dart:245:57)
I/flutter (11768): #1 MyHomePage.build.. (file:///G:/FlutterProjects/bloc_project/lib/main.dart:72:77)
I/flutter (11768): #2 SliverChildBuilderDelegate.build (package:flutter/src/widgets/sliver.dart:197:20)
I/flutter (11768): #3 SliverMultiBoxAdaptorElement._build. (package:flutter/src/widgets/sliver.dart:716:67)
I/flutter (11768): #4 _HashMap.putIfAbsent (dart:collection/runtime/libcollection_patch.dart:143:29)
I/flutter (11768): #5 SliverMultiBoxAdaptorElement._build (package:flutter/src/widgets/sliver.dart:716:26)
I/flutter (11768): #6 SliverMultiBoxAdaptorElement.createChild. (package:flutter/src/widgets/sliver.dart:729:55)
I/flutter (11768): #7 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2222:19)
I/flutter (11768): #8 SliverMultiBoxAdaptorElement.createChild (package:flutter/src/widgets/sliver.dart:722:11)
I/flutter (11768): #9 RenderSliverMultiBoxAdaptor._createOrObtainChild. (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:254:23)
I/flutter (11768): #10 RenderObject.invokeLayoutCallback. (package:flutter/src/rendering/object.dart:1666:58)
I/flutter (11768): #11 PipelineOwner._enableMutationsToDirtySubtrees (package:flutter/src/rendering/object.dart:740:15)
I/flutter (11768): #12 RenderObject.invokeLayoutCallback (package:flutter/src/rendering/object.dart:1666:13)
I/flutter (11768): #13 RenderSliverMultiBoxAdaptor._createOrObtainChild (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:243:5)
I/flutter (11768): #14 RenderSliverMultiBoxAdaptor.insertAndLayoutChild (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:381:5)
I/flutter (11768): #15 RenderSliverList.performLayout.advance (package:flutter/src/rendering/sliver_list.dart:190:19)
I/flutter (11768): #16 RenderSliverList.performLayout (package:flutter/src/rendering/sliver_list.dart:233:19)
I/flutter (11768): #17 RenderObject.layout (package:flutter/src/rendering/object.dart:1570:7)
I/flutter (11768): #18 RenderSliverPadding.performLayout (package:flutter/src/rendering/sliver_padding.dart:182:11)
I/flutter (11768): #19 RenderObject.layout (package:flutter/src/rendering/object.dart:1570:7)
I/flutter (11768): #20 RenderViewportBase.layoutChildSequence (package:flutter/src/rendering/viewport.dart:336:13)
I/flutter (11768): #21 RenderViewport._attemptLayout (package:flutter/src/rendering/viewport.dart:1172:12)
I/flutter (11768): #22 RenderViewport.performLayout (package:flutter/src/rendering/viewport.dart:1090:20)
I/flutter (11768): #23 RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1445:7)
I/flutter (11768): #24 PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:709:18)
I/flutter (11768): #25 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:270:19)
I/flutter (11768): #26 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:627:13)
I/flutter (11768): #27 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:208:5)
I/flutter (11768): #28 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
I/flutter (11768): #29 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
I/flutter (11768): #30 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:842:5)
I/flutter (11768): #31 _invoke (dart:ui/hooks.dart:120:13)
I/flutter (11768): #32 _drawFrame (dart:ui/hooks.dart:109:3)
I/flutter (11768):
I/flutter (11768): The following RenderObject was being processed when the exception was fired:
I/flutter (11768): RenderSliverList#08ab6 relayoutBoundary=up2
I/flutter (11768): creator: SliverList ← MediaQuery ← SliverPadding ← Viewport ← _ScrollableScope ←
I/flutter (11768): IgnorePointer-[GlobalKey#85f7b] ← Semantics ← Listener ← _GestureSemantics ←
I/flutter (11768): RawGestureDetector-[LabeledGlobalKey#92e9f] ←
I/flutter (11768): _ExcludableScrollSemantics-[GlobalKey#6b5a8] ← RepaintBoundary ← ⋯
I/flutter (11768): parentData: paintOffset=Offset(0.0, 0.0) (can use size)
I/flutter (11768): constraints: SliverConstraints(AxisDirection.down, GrowthDirection.forward,
I/flutter (11768): ScrollDirection.reverse, scrollOffset: 574.0, remainingPaintExtent: 619.9, crossAxisExtent: 423.5,
I/flutter (11768): crossAxisDirection: AxisDirection.right, viewportMainAxisExtent: 619.9, remainingCacheExtent:
I/flutter (11768): 1119.9 cacheOrigin: -250.0 )
I/flutter (11768): geometry: SliverGeometry(scrollExtent: 2608.0, paintExtent: 619.9, maxPaintExtent: 2608.0,
I/flutter (11768): hasVisualOverflow: true, cacheExtent: 1119.9)
I/flutter (11768): currently live children: 2 to 10
I/flutter (11768): This RenderObject had the following descendants (showing up to depth 5):
I/flutter (11768): RenderRepaintBoundary#18ff3 relayoutBoundary=up3
I/flutter (11768): RenderSemanticsGestureHandler#015a3 relayoutBoundary=up4
I/flutter (11768): RenderPointerListener#c3a82 relayoutBoundary=up5
I/flutter (11768): RenderSemanticsAnnotations#918d3 relayoutBoundary=up6
I/flutter (11768): RenderPadding#4edc5 relayoutBoundary=up7
I/flutter (11768): RenderRepaintBoundary#376be relayoutBoundary=up3
I/flutter (11768): RenderSemanticsGestureHandler#e66b4 relayoutBoundary=up4
I/flutter (11768): RenderPointerListener#a2e47 relayoutBoundary=up5
I/flutter (11768): RenderSemanticsAnnotations#cc5c2 relayoutBoundary=up6
I/flutter (11768): RenderPadding#4150a relayoutBoundary=up7
I/flutter (11768): RenderRepaintBoundary#8ab07 relayoutBoundary=up3
I/flutter (11768): RenderSemanticsGestureHandler#f969e relayoutBoundary=up4
I/flutter (11768): RenderPointerListener#303a9 relayoutBoundary=up5
I/flutter (11768): RenderSemanticsAnnotations#50415 relayoutBoundary=up6
I/flutter (11768): RenderPadding#ae58d relayoutBoundary=up7
I/flutter (11768): RenderRepaintBoundary#867d2 relayoutBoundary=up3
I/flutter (11768): RenderSemanticsGestureHandler#e4adc relayoutBoundary=up4
I/flutter (11768): RenderPointerListener#4de00 relayoutBoundary=up5
I/flutter (11768): RenderSemanticsAnnotations#057d5 relayoutBoundary=up6
I/flutter (11768): RenderPadding#c9e9c relayoutBoundary=up7
I/flutter (11768): RenderRepaintBoundary#74bb2 relayoutBoundary=up3
I/flutter (11768): RenderSemanticsGestureHandler#80263 relayoutBoundary=up4
I/flutter (11768): RenderPointerListener#2d321 relayoutBoundary=up5
I/flutter (11768): RenderSemanticsAnnotations#3d7cd relayoutBoundary=up6
I/flutter (11768): RenderPadding#ff3a8 relayoutBoundary=up7
I/flutter (11768): ...(descendants list truncated after 25 lines)
I/flutter (11768):

@figengungor
Copy link

Hi! It's related to string concatenation with + operator when posterPath is null. So you can either
use String interpolation like that:

String imageUrl = "https://image.tmdb.org/t/p/w92${snapshot.data[index].posterPath}"

or check if posterPath is null like that:

  String imageUrl = "https://image.tmdb.org/t/p/w92"
                          + (snapshot.data[index].posterPath ?? ""); 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants