Friday, 25 February 2022

'_lifecycleState != _ElementLifecycle.defunct': is not true. Error in Flutter

I've encountered an error which says

'_lifecycleState != _ElementLifecycle.defunct': is not true.

enter image description here

I came across this issue when I tried to change the state in dispose() method.

      @override
      void dispose() {
        setState(() => _successErrorLoader = "");
        setState(() => _ackMessage = "");
      }

I want to do some state changes when an component is unmounted (removed from the screen). Please provide any alternative solution or a fix for this error.



from '_lifecycleState != _ElementLifecycle.defunct': is not true. Error in Flutter

No comments:

Post a Comment