lianyagang / flutter_swiper_null_safety

根据大佬https://github.com/best-flutter/flutter_swiper修改到空安全swiper
MIT License
95 stars 48 forks source link

[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Looking up a deactivated widget's ancestor is unsafe. #11

Open yuanzhiying opened 2 years ago

yuanzhiying commented 2 years ago
E/flutter (30989): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Looking up a deactivated widget's ancestor is unsafe.
E/flutter (30989): At this point the state of the widget's element tree is no longer stable.
E/flutter (30989): To safely refer to a widget's ancestor in its dispose() method, save a reference to the ancestor by calling dependOnInheritedWidgetOfExactType() in the widget's didChangeDependencies() method.
E/flutter (30989): #0      Element._debugCheckStateIsActiveForAncestorLookup.<anonymous closure> (package:flutter/src/widgets/framework.dart:3990:9)
E/flutter (30989): #1      Element._debugCheckStateIsActiveForAncestorLookup (package:flutter/src/widgets/framework.dart:4004:6)
E/flutter (30989): #2      Element.visitAncestorElements (package:flutter/src/widgets/framework.dart:4089:12)
E/flutter (30989): #3      Notification.dispatch (package:flutter/src/widgets/notification_listener.dart:83:13)
E/flutter (30989): #4      ScrollActivity.dispatchScrollEndNotification (package:flutter/src/widgets/scroll_activity.dart:104:63)
E/flutter (30989): #5      ScrollPosition.didEndScroll (package:flutter/src/widgets/scroll_position.dart:907:15)
E/flutter (30989): #6      ScrollPosition.beginActivity (package:flutter/src/widgets/scroll_position.dart:876:9)
E/flutter (30989): #7      ScrollPositionWithSingleContext.beginActivity (package:flutter/src/widgets/scroll_position_with_single_context.dart:114:11)
E/flutter (30989): #8      ScrollPositionWithSingleContext.goIdle (package:flutter/src/widgets/scroll_position_with_single_context.dart:129:5)
E/flutter (30989): #9      ScrollPositionWithSingleContext.jumpTo (package:flutter/src/widgets/scroll_position_with_single_context.dart:195:5)
E/flutter (30989): #10     ScrollPositionWithSingleContext.animateTo (package:flutter/src/widgets/scroll_position_with_single_context.dart:177:7)
E/flutter (30989): #11     PageController.animateToPage (package:flutter/src/widgets/page_view.dart:201:21)
E/flutter (30989): #12     _TransformerPageViewState.onChangeNotifier (package:flutter_swiper_null_safety/src/transformer_page_view/transformer_page_view.dart:590:12)
E/flutter (30989): #13     ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart:308:24)
E/flutter (30989): #14     IndexController.next (package:flutter_swiper_null_safety/src/transformer_page_view/index_controller.dart:30:5)
E/flutter (30989): #15     _SwiperTimerMixin._onTimer (package:flutter_swiper_null_safety/src/swiper.dart:369:18)
E/flutter (30989): #16     _rootRunUnary (dart:async/zone.dart:1436:47)
E/flutter (30989): #17     _CustomZone.runUnary (dart:async/zone.dart:1335:19)
E/flutter (30989): #18     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
E/flutter (30989): #19     _CustomZone.bindUnaryCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1281:26)
E/flutter (30989): #20     _rootRunUnary (dart:async/zone.dart:1444:13)
E/flutter (30989): #21     _CustomZone.runUnary (dart:async/zone.dart:1335:19)
E/flutter (30989): #22     _CustomZone.bindUnaryCallback.<anonymous closure> (dart:async/zone.dart:1265:26)
E/flutter (30989): #23     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:395:19)
E/flutter (30989): #24     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:426:5)
E/flutter (30989): #25     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)

自动滚动,每滚动一次,报一次错。这个咋回事?

yuanzhiying commented 2 years ago

被销毁了,计时器还在走?