alex-melnyk / flutter_advanced_drawer

https://pub.dev/packages/flutter_advanced_drawer
https://pub.dev/packages/flutter_advanced_drawer
BSD 3-Clause "New" or "Revised" License
71 stars 23 forks source link

Runtime exception when siding the drawer #22

Closed ramvdixit closed 3 years ago

ramvdixit commented 3 years ago

Hello, Thank you for such a wonderful and easy to use Widget. There is however an exception I see when the drawer is dragged and I am posting the exception stack thread below. It is not stopping my app and there are no crashes. Please let me know if this is an error caused by my implementation (I am not doing much other than changing the logo, adding some extra Text widgets)

Thanks in advance.

════════ Exception caught by foundation library ════════════════════════════════════════════════════ The following assertion was thrown while dispatching notifications for AdvancedDrawerController: AnimationController.forward() called after AnimationController.dispose() AnimationController methods should not be used after calling dispose. 'package:flutter/src/animation/animation_controller.dart': Failed assertion: line 455 pos 7: '_ticker != null'

When the exception was thrown, this was the stack:

2 AnimationController.forward (package:flutter/src/animation/animation_controller.dart:455:7)

3 _AdvancedDrawerState.handleControllerChanged (package:flutter_advanced_drawer/src/widget.dart:211:32)

4 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart:308:24)

5 ValueNotifier.value= (package:flutter/src/foundation/change_notifier.dart:412:5)

6 AdvancedDrawerController.showDrawer (package:flutter_advanced_drawer/src/controller.dart:11:5)

7 _AdvancedDrawerState._handleDragEnd (package:flutter_advanced_drawer/src/widget.dart:244:21)

8 DragGestureRecognizer._checkEnd. (package:flutter/src/gestures/monodrag.dart:486:47)

9 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:198:24)

10 DragGestureRecognizer._checkEnd (package:flutter/src/gestures/monodrag.dart:486:5)

11 DragGestureRecognizer.didStopTrackingLastPointer (package:flutter/src/gestures/monodrag.dart:393:9)

12 OneSequenceGestureRecognizer.stopTrackingPointer (package:flutter/src/gestures/recognizer.dart:392:9)

13 DragGestureRecognizer._giveUpPointer (package:flutter/src/gestures/monodrag.dart:402:5)

14 DragGestureRecognizer.handleEvent (package:flutter/src/gestures/monodrag.dart:321:7)

15 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:94:12)

16 PointerRouter._dispatchEventToRoutes. (package:flutter/src/gestures/pointer_router.dart:139:9)

17 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:400:8)

18 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:137:18)

19 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:123:7)

20 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:440:19)

21 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:420:22)

22 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:278:11)

23 GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:374:7)

24 GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:338:5)

25 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:296:7)

26 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:279:7)

30 _invoke1 (dart:ui/hooks.dart:185:10)

31 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:293:7)

32 _dispatchPointerDataPacket (dart:ui/hooks.dart:98:31)

(elided 5 frames from class _AssertionError and dart:async) The AdvancedDrawerController sending notification was: AdvancedDrawerController#9ee43(Instance of 'AdvancedDrawerValue') ════════════════════════════════════════════════════════════════════════════════════════════════════

giovanni256 commented 1 year ago

Hi, same issue here in 1.3.5 @ramvdixit

════════ Exception caught by foundation library ════════════════════════════════
AnimationController.forward() called after AnimationController.dispose()
AnimationController methods should not be used after calling dispose.
'package:flutter/src/animation/animation_controller.dart':
animation_controller.dart:1
Failed assertion: line 453 pos 7: '_ticker != null'

════════════════════════════════════════════════════════════════════════════════