Container(
child: Column(
children: <Widget>[
Container(
height: 64,
width: 64,
decoration: BoxDecoration(color: Colors.yellow,
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.05),
blurRadius: 3,
spreadRadius: 4
)
]
),
),
SizedBox(
height: 8,),
Text("Critani")
],
),
),
您可以使用Navigator API(Navigator.pushNamed 或 Navigator.push(。您可以在 MaterialApp 中声明路由,如下所示:
routes: <String, WidgetBuilder>{
'/fullText': (BuildContext context) => FullText(),
'/facts': (BuildContext context) => Facts(),
},
然后,您可以将其与onTap一起使用,例如:
onTap: () => Navigator.pushNamed(context, "/facts),
我希望这是有用的,如果不清楚,请随时提问!