I have a Text widget
on pressing which another Route
has to be shown. But I could not see any onPressed() method for the Text widget
. Plea
Use InkWell
this gives you nice ripple effect as well
new InkWell(
onTap: () {
Navigator.pushNamed(context, "YourRoute");
},
child: new Padding(
padding: new EdgeInsets.all(10.0),
child: new Text("Tap Here"),
),
);
or
new FlatButton(
onPressed: () {
Navigator.pushNamed(context, "YourRoute");
},
child: new Text("Tap Here"),
)