导航器在登录按钮内部不起作用。

huangapple go评论52阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年2月8日 21:56:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/75386824.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定