Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Dart 我能';不要在按下按钮时翻过另一页_Dart_Flutter - Fatal编程技术网

Dart 我能';不要在按下按钮时翻过另一页

Dart 我能';不要在按下按钮时翻过另一页,dart,flutter,Dart,Flutter,我想在按下压力机上的代码时转到另一页,但它不起作用。 DialogButton( onPressed: () => FirstTab(), color: Color(0xff78328a), child: Text( "DAÜ'ye / To EMU", style: TextStyle( color: Colors.white, fontSize: 20, fontWeight: FontWei

我想在按下压力机上的代码时转到另一页,但它不起作用。

 DialogButton(
      onPressed: () => FirstTab(),
      color: Color(0xff78328a),
      child: Text(
        "DAÜ'ye / To EMU",
        style: TextStyle(
            color: Colors.white, fontSize: 20, fontWeight: FontWeight.bold),
      ),
    ),

您已经使用了
Navigator。按
,以便在按下的
on中移动到下一页

Navigator.push(context, new MaterialPageRoute(
                        builder: (BuildContext context) {
                          return new PageName();
                        }));

您应该将
onPressed
方法修改为:

  onPressed: () => Navigator.of(context).push(MaterialPageRoute(builder: (context) => FirstTab()));

请提供更多信息:您正在使用哪个图书馆?