Another exception was thrown: 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 2216 pos 12: '!_debugLocked': is not true Another exception was thrown: 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 2216 pos 12: '!_debugLocked': is not true flutter flutter

Another exception was thrown: 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 2216 pos 12: '!_debugLocked': is not true


If you are facing issue at the time of 2 dialogs open on 1 screen.. Just put one dialogue in this Future.delayed...

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


An onPressed or onTap listener of a button that opens a dialog must be causing this.Simply add onPressed : () { myFunction(); ).This was something that worked for like a charm for me.


when i had experienced this useless error text it was because of screen root widget had no defined / finite size, i had at the root a "SingleChildScrollView",

to solve this i simply wrapped it in Container and set the height to screen max height like this:

  @override  Widget build(BuildContext context) {    return Container(      height: MediaQuery.of(context).size.height,      child: SingleChildScrollView(        child: ...      ),    ),  }