如何在Flutter中使用List <widget>小部件将小部件放在小部件上方?

时间:2019-01-23 16:04:33

标签: flutter flutter-layout

最终列表小部件= [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: 
                      ..........?????????                         
                     ),
                    ),
                  ),    
                ],
              ),
            ),
          );
        }),
  ),
);

}

0 个答案:

没有答案