Skip to content

Conflict between SlidableAutoCloseBehavior and custom SlidableController #532

@cerenyasa

Description

@cerenyasa

The issue described #482 still persists.
When the list is wrapped with SlidableAutoCloseBehavior and a custom SlidableController is assigned to any item, triggering open() or close() programmatically results in the following error.

Previously, adding a const Key used to resolve the issue, but that no longer works.

Could you please take another look?

`The following assertion was thrown while notifying status listeners for AnimationController:
This widget has been unmounted, so the State no longer has a context (and should be considered defunct).

Consider canceling any active work during "dispose" or using the "mounted" getter to determine if the State is still active.
When the exception was thrown, this was the stack:
#0 State.context. (package:flutter/src/widgets/framework.dart:952:9)
#1 State.context (package:flutter/src/widgets/framework.dart:958:6)
#2 _SlidableAutoCloseBarrierNotificationSenderState._handleStatusChanged (package:flutter_slidable/src/auto_close_behavior.dart:361:9)
#3 _SlidableNotificationSenderState.handleStatusChanged (package:flutter_slidable/src/auto_close_behavior.dart:531:29)
#4 AnimationLocalStatusListenersMixin.notifyStatusListeners (package:flutter/src/animation/listener_helpers.dart:243:19)
#5 AnimationController._checkStatusChanged (package:flutter/src/animation/animation_controller.dart:945:7)
#6 AnimationController._startSimulation (package:flutter/src/animation/animation_controller.dart:878:5)
#7 AnimationController._animateToInternal (package:flutter/src/animation/animation_controller.dart:688:12)
#8 AnimationController.animateBack (package:flutter/src/animation/animation_controller.dart:637:12)
#9 SlidableController.close (package:flutter_slidable/src/controller.dart:264:32)
...
#13 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:345:24)
#14 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:737:11)
#15 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:362:5)
#16 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:332:7)
#17 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:173:27)
#18 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:534:20)
#19 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:499:22)
#20 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:473:11)
#21 GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:437:7)
#22 GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:394:5)
#23 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:341:7)
#24 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:308:9)
#28 _invoke1 (dart:ui/hooks.dart:349:10)
#29 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:467:7)
#30 _dispatchPointerDataPacket (dart:ui/hooks.dart:282:31)
(elided 3 frames from dart:async)
The AnimationController notifying status listeners was: AnimationController#736ba(◀ 0.350)
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions