I am running into a globalKey error after I navigate from Screen A to Screen B and click a \"Cancel\" button to go back to Scree
In my case I wanted to use the static GlobalKey but when I used the same widget multiple times it gave this duplicate error.
I wanted to give it a unique string and still use this scaffold state. So I ended up using:
static GlobalObjectKey _scaffoldKey
and in the initState:
_scaffoldKey = new GlobalObjectKey(id);
Edit:
Actually, silly me. I just simply removed the static and made it GlobalKey again :)