Resource View load more on scroll to bottom

I am trying to use the

loadMoreWidgetBuilder

But it just gives me an error about box constraints. I can't add more resources in this method.

4 Replies

IR Indumathi Ravichandran Syncfusion Team July 15, 2022 08:59 AM UTC

Hi Ryein,


Based on the shared information, we have checked the issue ”Error occurred while using resource with loadmorewidget builder in Flutter Calendar” and we are unable to reproduce the any error from our end and it was working fine as expected. We have prepared the simple sample for the same. Please find the sample from the following link.


Sample link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/resourceview666232290.zip


Please check the sample and let us know if you still facing the same issue? If not, please modify the sample based on your scenario and revert us with following details.

  • Issue replication procedure

  • Error reproducing video


Regards,

Indumathi R



RG Ryein Goddard July 16, 2022 12:16 AM UTC

It is a good example for adding a single resource, but when I tried to add multiple resources it just fails.  So I was thinking I had to load more resources and appoints on scroll, but that fails as well.  Look at the error below.

I am testing on a decently new device a Pixel 6 Pro.  I think it has enough  memory to handle it.


It always complains about box constraints.  I can't load more than like 10 resources.

The following RangeError was thrown during paint():
RangeError (end): Invalid value: Only valid value is 0: 1
The relevant error-causing widget was
SfCalendar
lib/…/events/shift_schedule.dart:510
When the exception was thrown, this was the stack



-------
#102 RenderBoxContainerDefaultsMixin.defaultPaint
package:flutter/…/rendering/box.dart:2844
#103 RenderCustomMultiChildLayoutBox.paint
package:flutter/…/rendering/custom_layout.dart:408
#104 RenderObject._paintWithContext
package:flutter/…/rendering/object.dart:2477
#105 PaintingContext.paintChild
package:flutter/…/rendering/object.dart:187
#106 RenderProxyBoxMixin.paint
package:flutter/…/rendering/proxy_box.dart:140
#107 _RenderInkFeatures.paint
package:flutter/…/material/material.dart:604
#108 RenderObject._paintWithContext
package:flutter/…/rendering/object.dart:2477
#109 PaintingContext.paintChild
package:flutter/…/rendering/object.dart:187
#110 PaintingContext.pushLayer
package:flutter/…/rendering/object.dart:387
#111 RenderPhysicalModel.paint
package:flutter/…/rendering/proxy_box.dart:1951
#112 RenderObject._paintWithContext
package:flutter/…/rendering/object.dart:2477
#113 PaintingContext.paintChild
package:flutter/…/rendering/object.dart:187
#114 RenderShiftedBox.paint
package:flutter/…/rendering/shifted_box.dart:79
#115 RenderObject._paintWithContext
package:flutter/…/rendering/object.dart:2477
#116 PaintingContext.paintChild
package:flutter/…/rendering/object.dart:187
#117 RenderProxyBoxMixin.paint
package:flutter/…/rendering/proxy_box.dart:140
#118 RenderObject._paintWithContext
package:flutter/…/rendering/object.dart:2477
#119 PaintingContext.paintChild
package:flutter/…/rendering/object.dart:187
#120 RenderProxyBoxMixin.paint
package:flutter/…/rendering/proxy_box.dart:140
#121 RenderObject._paintWithContext
package:flutter/…/rendering/object.dart:2477
#122 PaintingContext._repaintCompositedChild
package:flutter/…/rendering/object.dart:141
#123 PaintingContext.repaintCompositedChild
package:flutter/…/rendering/object.dart:100
#124 PipelineOwner.flushPaint
package:flutter/…/rendering/object.dart:995
#125 RendererBinding.drawFrame
package:flutter/…/rendering/binding.dart:506
#126 WidgetsBinding.drawFrame
package:flutter/…/widgets/binding.dart:892
#127 RendererBinding._handlePersistentFrameCallback
package:flutter/…/rendering/binding.dart:370
#128 SchedulerBinding._invokeFrameCallback
package:flutter/…/scheduler/binding.dart:1146
#129 SchedulerBinding.handleDrawFrame
package:flutter/…/scheduler/binding.dart:1083
#130 SchedulerBinding._handleDrawFrame
package:flutter/…/scheduler/binding.dart:997
#134 _invoke (dart:ui/hooks.dart:151:10)
#135 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:308:5)
#136 _drawFrame (dart:ui/hooks.dart:115:31)
(elided 3 frames from dart:async)
The following RenderObject was being processed when the exception was fired: _ResourceViewRenderObject#a5d5c relayoutBoundary=up5
RenderObject: _ResourceViewRenderObject#a5d5c relayoutBoundary=up5
parentData: <none> (can use size)
constraints: BoxConstraints(w=75.0, 0.0<=h<=Infinity)
size: Size(75.0, 1955.0)
════════════════════════════════════════════════════════════════════════════════




RG Ryein Goddard July 16, 2022 06:46 PM UTC

I think I have figured out the issue.  It appears the Text area for names doesn't like some characters.



IR Indumathi Ravichandran Syncfusion Team July 18, 2022 10:00 AM UTC

Hi Ryein,


Regarding Query:
I was thinking I had to load more resources and appoints on scrol
l.


As per the current implementation of the calendar, can’t load the more resources on scrolling, you can load the appointments only via on-demand. Also, we have UG documentation for the same. Please find the UG from the following link.


UG link: https://help.syncfusion.com/flutter/calendar/load-more


Also we have prepared the simple sample for adding 10 resources dynamically with special characters in resource display name. But we are unable to reproduce the any crash from our end. Please find the sample from the following link.


Sample link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/resourceview_(1)640144348.zip


We hope that this helps you.If possible, can you please share the issue in simple sample or share the below details.


·       Code snippet

It would be helpful for us to analyze and provide you a solution at the earliest.


Regards,

Indumathi R


Loader.
Up arrow icon