Navigator routes Clear the stack of flutter

前端 未结 1 1695
猫巷女王i
猫巷女王i 2021-02-11 14:05

In my app i have three screens login , verifyotp , generatepass. I know how to move from one page to other page eg: Navigator.pushNamed(context, \"/theNameOfThePage\");

相关标签:
1条回答
  • 2021-02-11 14:24

    Full clean of Navigator's history and navigate to new route:

    void _logout() {
       Navigator.pushNamedAndRemoveUntil(context, "/newRouteName", (r) => false);
    }
    
    0 讨论(0)
提交回复
热议问题