Reputation:
I want to go to the other page when I clicked with the code on the press, but it doesn't work.
DialogButton(
onPressed: () => FirstTab(),
color: Color(0xff78328a),
child: Text(
"DAÜ'ye / To EMU",
style: TextStyle(
color: Colors.white, fontSize: 20, fontWeight: FontWeight.bold),
),
),
Upvotes: 0
Views: 65
Reputation: 7889
You should modify your onPressed
method into this :
onPressed: () => Navigator.of(context).push(MaterialPageRoute(builder: (context) => FirstTab()));
Upvotes: 1
Reputation: 2436
You have use Navigator.push
in order to move to next page like this in your onPressed
Navigator.push(context, new MaterialPageRoute(
builder: (BuildContext context) {
return new PageName();
}));
Upvotes: 0