在顶部和底部向列表视图添加控件

在顶部和底部向列表视图添加控件,第1张

在顶部和底部向列表视图添加控件

您可以通过在列表视图内使用listview来实现此目的,下面是示例代码,请检查

 body: ListView(    children: <Widget>[      Container(        height: 40,        color: Colors.deepOrange,        child: Center(          child: Text( 'Header', style: TextStyle(color: Colors.white, fontSize: 16),          ),        ),      ),      ListView.builder(        physics: ScrollPhysics(),        shrinkWrap: true,        itemCount: 50,        itemBuilder: (BuildContext context, int index) {          return Container( color: Colors.lime, height: 60, child: Center(   child: Text(     'Child $index',     style: TextStyle(color: Colors.black, fontSize: 16),   ), ),          );        },      ),      Container(        height: 40,        color: Colors.deepOrange,        child: Center(          child: Text( 'Footer', style: TextStyle(color: Colors.white, fontSize: 16),          ),        ),      ),    ],  ),


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/4945560.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-11-13
下一篇2022-11-13

发表评论

登录后才能评论

评论列表(0条)

    保存