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()));
请提供更多信息:您正在使用哪个图书馆?