英文:
Navigator is not working inside login button
问题
I have to go to Supplier screen when we click login button, i used navigator.push , but it is not working. i used the navigator.push in many other button it is working properly. but for the login its not working.
Padding(
padding: const EdgeInsets.only(right: 8),
child: YellowButton(
label: 'Sign Up',
onPressed: () {
Navigator.pushReplacementNamed(
context, '/supplier_home');
},
width: 0.25),
),
so why it is not working. not understanding, it is inside the scaffold
英文:
I have to go to Supplier screen when we click login button, i used navigator.push , but it is not working. i used the navigator.push in many other button it is working properly. but for the login its not working.
Padding(
padding: const EdgeInsets.only(right: 8),
child: YellowButton(
label: 'Sign Up',
onPressed: () {
Navigator.pushReplacementNamed(
context, '/supplier_home');
},
width: 0.25),
),
so why it is not working. not understanding, it is inside the scaffold
答案1
得分: 1
确保在您的 main.dart 文件中使用 MaterialApp 的 "routes" 属性声明了 /supplier_home 路由。如果已声明,请确保它们拼写相同。
英文:
Make sure the /supplier_home route is declared in your main.dart file using the "routes" property of MaterialApp. And if it is, make sure they're both spelled the same.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论