flutterdart

Error: _AssertionError ('package:flutter/src/widgets/navigator.dart': Failed assertion: line 4893 pos 12: '!_debugLocked': is not true.)


I face a problem about _AssertionError ('package:flutter/src/widgets/navigator.dart': Failed assertion: line 4893 pos 12: '!_debugLocked': is not true.). I've been looking for a way to fix this for a long time, but I still can't find a solution.

Error picture

I would be very grateful for any user help.


Solution

  • Just add this to your code:

    Future.delayed(Duration.zero, () {
      Navigator.pop(context);
    });