最终列表小部件= [Home1(),Home2(),Home3()];
@override 小部件build(BuildContext context){ 返回新的脚手架( 正文:新容器( 子级:新的PageView.builder( 控制器:新的PageController( viewportFraction:1.0, ), itemCount:widget.length, itemBuilder:(BuildContext上下文,int i){
return Padding(
padding: const EdgeInsets.symmetric(
horizontal: 5.0,
vertical: 22.0,
),
child: Material(
borderRadius: BorderRadius.circular(15.0,),
elevation: 1.0,
child: Stack(
fit: StackFit.expand,
children: <Widget>[
Hero(
tag: widget[i],
child: Material(
child: InkWell(
onTap:()=> Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context)=> Home(),
),
),
child:
..........?????????
),
),
),
],
),
),
);
}),
),
);
}