Duplicate GlobalKey detected in widget tree

前端 未结 10 1118
孤街浪徒
孤街浪徒 2021-01-03 19:21

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

10条回答
  •  抹茶落季
    2021-01-03 19:29

    I had this issue too. I had a four screen bottom tabbed application and a 'logout' method. However, that logout method was calling a pushReplacementNamed. This prevented the class that held the global keys (different from the logout function) from calling dispose.

    The resolution was to change pushReplacementNamed with popAndPushNamed to get back to my 'login' screen.

提交回复
热议问题