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

Pls add callback #28

Closed
ziqq opened this issue Apr 25, 2022 · 7 comments
Closed

Pls add callback #28

ziqq opened this issue Apr 25, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@ziqq
Copy link
Contributor

ziqq commented Apr 25, 2022

image

@ziqq
Copy link
Contributor Author

ziqq commented Apr 25, 2022

I added pull request, check it plz

@gonuit gonuit added the bug Something isn't working label May 26, 2022
@RBT22
Copy link
Contributor

RBT22 commented Jun 3, 2022

@gonuit Is there any problem with this fix? or why don't you just approve it?

The following assertion was thrown while dispatching notifications for IndicatorController:
Build scheduled during frame.

While the widget tree was being built, laid out, and painted, a new frame was scheduled to rebuild the widget tree.

This might be because setState() was called from a layout or paint callback. If a change is needed to the widget tree, it should be applied as the tree is being built. Scheduling a change for the subsequent frame instead results in an interface that lags behind by one frame. If this was done to make your build dependent on a size measured at layout time, consider using a LayoutBuilder, CustomSingleChildLayout, or CustomMultiChildLayout. If, on the other hand, the one frame delay is the desired effect, for example because this is an animation, consider scheduling the frame in a post-frame callback using SchedulerBinding.addPostFrameCallback or using an AnimationController to trigger the animation.

When the exception was thrown, this was the stack: 
#0      WidgetsBinding._handleBuildScheduled.<anonymous closure> (package:flutter/src/widgets/binding.dart:756:9)
#1      WidgetsBinding._handleBuildScheduled (package:flutter/src/widgets/binding.dart:779:6)
#2      BuildOwner.scheduleBuildFor (package:flutter/src/widgets/framework.dart:2482:24)
#3      Element.markNeedsBuild (package:flutter/src/widgets/framework.dart:4495:12)
#4      State.setState (package:flutter/src/widgets/framework.dart:1129:15)
#5      ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart:324:24)
#6      IndicatorController.setAxisDirection (package:custom_refresh_indicator/src/controller.dart:115:5)
#7      CustomRefreshIndicatorState._handleScrollStartNotification (package:custom_refresh_indicator/src/custom_refresh_indicator.dart:209:16)
#8      CustomRefreshIndicatorState._handleScrollNotification (package:custom_refresh_indicator/src/custom_refresh_indicator.dart:376:14)
#9      _NotificationElement.onNotification (package:flutter/src/widgets/notification_listener.dart:130:38)
#10     _NotificationNode.dispatchNotification (package:flutter/src/widgets/framework.dart:3078:18)
#11     _NotificationNode.dispatchNotification (package:flutter/src/widgets/framework.dart:3081:13)
#12     _NotificationNode.dispatchNotification (package:flutter/src/widgets/framework.dart:3081:13)
#13     Element.dispatchNotification (package:flutter/src/widgets/framework.dart:4375:24)
#14     Notification.dispatch (package:flutter/src/widgets/notification_listener.dart:60:13)
#15     ScrollActivity.dispatchScrollStartNotification (package:flutter/src/widgets/scroll_activity.dart:89:65)
#16     ScrollPosition.didStartScroll (package:flutter/src/widgets/scroll_position.dart:895:15)
#17     ScrollPosition.beginActivity (package:flutter/src/widgets/scroll_position.dart:887:7)
#18     ScrollPositionWithSingleContext.beginActivity (package:flutter/src/widgets/scroll_position_with_single_context.dart:114:11)
#19     ScrollPositionWithSingleContext.goBallistic (package:flutter/src/widgets/scroll_position_with_single_context.dart:146:7)
#20     IdleScrollActivity.applyNewDimensions (package:flutter/src/widgets/scroll_activity.dart:157:14)
#21     ScrollPosition.applyNewDimensions (package:flutter/src/widgets/scroll_position.dart:623:15)
#22     ScrollPositionWithSingleContext.applyNewDimensions (package:flutter/src/widgets/scroll_position_with_single_context.dart:104:11)
#23     ScrollPosition.applyContentDimensions (package:flutter/src/widgets/scroll_position.dart:553:7)
#24     RenderViewport.performLayout (package:flutter/src/rendering/viewport.dart:1493:20)
#25     RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1757:7)
#26     PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:887:18)
#27     RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:504:19)
#28     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:892:13)
#29     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:370:5)
#30     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1146:15)
#31     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1083:9)
#32     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:997:5)
#36     _invoke (dart:ui/hooks.dart:151:10)
#37     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:308:5)
#38     _drawFrame (dart:ui/hooks.dart:115:31)
(elided 3 frames from dart:async)
The IndicatorController sending notification was: Instance of 'IndicatorController'

@gonuit
Copy link
Owner

gonuit commented Jun 3, 2022

Hi, @Jordan1122 and @ziqq -- sorry for the long waiting time − I'm already working on it ⏲️

@RBT22
Copy link
Contributor

RBT22 commented Jun 3, 2022

Thank you very much! 🤗

@gonuit
Copy link
Owner

gonuit commented Jun 3, 2022

Version 1.1.2 is available on the pub.dev 💪🏻 and ready for your tests 🕵🏻

@gonuit gonuit closed this as completed Jun 3, 2022
@ziqq
Copy link
Contributor Author

ziqq commented Jun 6, 2022

Fix it plz

image

@RBT22
Copy link
Contributor

RBT22 commented Jun 6, 2022

This problem is caused by #30. Updating the compatibility to 3.0.0 this way comes with losing older versions...

This is a good example of the correct approach:
rive-app/rive-flutter@50aceab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants