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

Exception when sliding panel #11

Open
hoiihop opened this issue Nov 3, 2022 · 3 comments
Open

Exception when sliding panel #11

hoiihop opened this issue Nov 3, 2022 · 3 comments

Comments

@hoiihop
Copy link

hoiihop commented Nov 3, 2022

The following assertion was thrown while dispatching notifications for SlidingUpPanelController:
AnimationController.animateTo() called after AnimationController.dispose()
AnimationController methods should not be used after calling dispose.
'package:flutter/src/animation/animation_controller.dart':
Failed assertion: line 533 pos 7: '_ticker != null'

When the exception was thrown, this was the stack: 
#2      AnimationController.animateTo (package:flutter/src/animation/animation_controller.dart:533:7)
#3      _SlidingUpPanelWidgetState.expand (package:flutter_sliding_up_panel/sliding_up_panel_widget.dart:332:26)
#4      _SlidingUpPanelWidgetState.handlePanelStatusChanged (package:flutter_sliding_up_panel/sliding_up_panel_widget.dart:365:9)
#5      ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart:351:24)
#6      ValueNotifier.value= (package:flutter/src/foundation/change_notifier.dart:456:5)
#7      _SlidingUpPanelWidgetState.expand (package:flutter_sliding_up_panel/sliding_up_panel_widget.dart:334:28)
#8      _SlidingUpPanelWidgetState._handleDragEnd (package:flutter_sliding_up_panel/sliding_up_panel_widget.dart:297:9)
#9      DragGestureRecognizer._checkEnd.<anonymous closure> (package:flutter/src/gestures/monodrag.dart:521:47)
#10     GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:253:24)
#11     DragGestureRecognizer._checkEnd (package:flutter/src/gestures/monodrag.dart:521:5)
#12     DragGestureRecognizer.didStopTrackingLastPointer (package:flutter/src/gestures/monodrag.dart:426:9)
#13     OneSequenceGestureRecognizer.stopTrackingPointer (package:flutter/src/gestures/recognizer.dart:446:9)
#14     DragGestureRecognizer._giveUpPointer (package:flutter/src/gestures/monodrag.dart:435:5)
#15     DragGestureRecognizer.handleEvent (package:flutter/src/gestures/monodrag.dart:354:7)
#16     PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:98:12)
#17     PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:143:9)
#18     _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:617:13)
#19     PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:141:18)
#20     PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:127:7)
#21     GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:460:19)
#22     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:440:22)
#23     RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:337:11)
#24     GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:395:7)
#25     GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:357:5)
#26     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:314:7)
#27     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:295:7)
#28     _invoke1 (dart:ui/hooks.dart:167:13)
#29     PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:341:7)
#30     _dispatchPointerDataPacket (dart:ui/hooks.dart:94:31)
(elided 2 frames from class _AssertionError)
The SlidingUpPanelController sending notification was: SlidingUpPanelController#6b6cf(SlidingUpPanelStatus.expanded)
@brasizza
Copy link

brasizza commented Nov 4, 2022

Same here

@PashaArkus
Copy link

I had the same situation and the problem was that the SlidingUpPanelController was in a separate file and was not recreated when the state of the widget where it was called changed. This is how the animation controller tried to trigger an animation on a legacy widget.

@MirzaAhmedBaig
Copy link

call dispose on SlidingUpPanelController inside dispose() of statefull widget.

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

4 participants