I'm experiencing a Bad state: No element error and issues related to calling AnimationController methods after it has been disposed. The error occurs when updating the callback in the StoryView. Here is the stack trace:

This occurs when making updates in the onStoryShow callback, resulting in an animation issue. Specifically, the problem arises when AnimationController methods are called after the controller has been disposed.
My Code here :

void updateStoryIndex(WidgetRef ref,int newIndex) {
ref.read(storyIndexState.notifier).update((state) => newIndex);
}
Please help !