我创建了一个列表视图,其中我使用了 gero 小部件我已经将所有英雄小部件和列表视图小部件包装在材料中但我仍然收到此错误并且当我单击 listtile 时它工作正常但是当我来到第二页时我不是可以回去
主页:
body: Material(
child: ListView(
children: [
Hero(
tag: nyc_img,
child: ListTile(
leading: Image.network(
nyc_img,
height: 100,
width: 100,
),
title: Text("New York City"),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => NYCpage()),
);
},
),
),
],
),
第二页:
body: Center(
child: Material(
type: MaterialType.transparency,
child: Hero(
tag: nyc_img,
child: Image.network(nyc_img),
),
),
),