TheAnkurPanchani / card_swiper

Swiper/Carousel for flutter, with multiple layouts, infinite loop. Compatible with Android & iOS.
MIT License
155 stars 110 forks source link

The SwiperController sending notification was: Instance of 'SwiperController'` #45

Open baseSky opened 2 years ago

baseSky commented 2 years ago

Am I missing any steps? Please help me

The following _CastError was thrown while dispatching notifications for SwiperController:
Null check operator used on a null value

When the exception was thrown, this was the stack: 
#0      ScrollPosition.viewportDimension (package:flutter/src/widgets/scroll_position.dart:175:53)
#1      _PagePosition.getPixelsFromPage (package:flutter/src/widgets/page_view.dart:396:19)
#2      PageController.animateToPage (package:flutter/src/widgets/page_view.dart:202:16)
#3      _TransformerPageViewState.onChangeNotifier (package:card_swiper/src/transformer_page_view/transformer_page_view.dart:580:14)
#4      ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart:308:24)
#5      IndexController.next (package:card_swiper/src/transformer_page_view/index_controller.dart:110:5)
#6      _SwiperTimerMixin._onTimer (package:card_swiper/src/swiper.dart:391:17)
(elided 3 frames from class _RawReceivePortImpl and class _Timer)
The SwiperController sending notification was: Instance of 'SwiperController'
baseSky commented 2 years ago

Preliminary findings, set autoplay:true That's it

lan2000 commented 1 year ago

I have the same problem.

easy_refresh: ^3.3.0+1

[√] Flutter (Channel stable, 3.3.9, on Microsoft Windows [版本 10.0.19042.630], locale zh-CN) • Flutter version 3.3.9 on channel stable at D:\flutter\flutter • Upstream repository https://github.com/flutter/flutter/ • FLUTTER_GIT_URL = https://github.com/flutter/flutter/ • Framework revision b8f7f1f986 (3 months ago), 2022-11-23 06:43:51 +0900 • Engine revision 8f2221fbef • Dart version 2.18.5 • DevTools version 2.15.0

WLZ AL10 (mobile) • FMLDU19C13016286 • android-arm64 • Android 10 (API 29)


I/flutter (24137): ══╡ EXCEPTION CAUGHT BY ANIMATION LIBRARY ╞══════════════════════
I/flutter (24137): The following _CastError was thrown while notifying listeners for
I/flutter (24137): AnimationController:
I/flutter (24137): Null check operator used on a null value
I/flutter (24137): 
I/flutter (24137): When the exception was thrown, this was the stack:
I/flutter (24137): #0      Element.widget (package:flutter/src/widgets/framework.dart:3251:31)
I/flutter (24137): #1      _NotificationElement.onNotification (package:flutter/src/widgets/notification_listener.dart:128:46)
I/flutter (24137): #2      _NotificationNode.dispatchNotification (package:flutter/src/widgets/framework.dart:3094:18)
I/flutter (24137): #3      _NotificationNode.dispatchNotification (package:flutter/src/widgets/framework.dart:3097:13)
I/flutter (24137): #4      _NotificationNode.dispatchNotification (package:flutter/src/widgets/framework.dart:3097:13)
I/flutter (24137): #5      Element.dispatchNotification (package:flutter/src/widgets/framework.dart:4441:24)
I/flutter (24137): #6      Notification.dispatch (package:flutter/src/widgets/notification_listener.dart:60:13)
I/flutter (24137): #7      ScrollActivity.dispatchScrollUpdateNotification (package:flutter/src/widgets/scroll_activity.dart:92:92)
I/flutter (24137): #8      ScrollPosition.didUpdateScrollPositionBy (package:flutter/src/widgets/scroll_position.dart:914:15)
I/flutter (24137): #9      ScrollPosition.setPixels (package:flutter/src/widgets/scroll_position.dart:282:9)
I/flutter (24137): #10     ScrollPositionWithSingleContext.setPixels (package:flutter/src/widgets/scroll_position_with_single_context.dart:78:18)
I/flutter (24137): #11     DrivenScrollActivity._tick (package:flutter/src/widgets/scroll_activity.dart:647:18)
I/flutter (24137): #12     AnimationLocalListenersMixin.notifyListeners (package:flutter/src/animation/listener_helpers.dart:161:19)
I/flutter (24137): #13     AnimationController._tick (package:flutter/src/animation/animation_controller.dart:837:5)
I/flutter (24137): #14     Ticker._tick (package:flutter/src/scheduler/ticker.dart:249:12)
I/flutter (24137): #15     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1175:15)
I/flutter (24137): #16     SchedulerBinding.handleBeginFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:1079:11)
I/flutter (24137): #17     _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:617:13)
I/flutter (24137): #18     SchedulerBinding.handleBeginFrame (package:flutter/src/scheduler/binding.dart:1077:17)
I/flutter (24137): #22     _invoke1 (dart:ui/hooks.dart:169:10)
I/flutter (24137): (elided 3 frames from dart:async)
I/flutter (24137): 
I/flutter (24137): The AnimationController notifying listeners was:
I/flutter (24137):   AnimationController#316c6(▶ 166000000670.188; for
I/flutter (24137):   DrivenScrollActivity)