Duplicate GlobalKey detected in widget tree

前端 未结 10 1181
孤街浪徒
孤街浪徒 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:50

    Remove the static and final type from the key variable so if

    static final GlobalKey _abcKey = GlobalKey();
    

    change it to

    GlobalKey _abcKey = GlobalKey();
    

提交回复
热议问题