码迷,mamicode.com
首页 > 其他好文 > 详细

SliverList , SliverFixedExtentList

时间:2019-04-05 19:49:55      阅读:379      评论:0      收藏:0      [点我收藏+]

标签:count   scroll   pos   turn   highlight   高度   tom   ack   uil   

 

SliverList 高度自动,
SliverFixedExtentList 高度固定死.
CustomScrollView(
              slivers:[
                
                SliverList(
                  delegate: SliverChildBuilderDelegate((context, int index){
                    Container postPiece;
                    if (index == 0){
                      postPiece = Container(
                        child: Text(‘$index , aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa‘, style: TextStyle(color: Colors.grey),),
                      );
                    } else {
                      postPiece = Container(
                        child: Text(‘$index, bbbbbbbbbbbbb‘, style: TextStyle(color: Colors.black),),
                      );
                    }
                    return postPiece;
                  },
                    childCount: 100,
                  ),
                ),
                
//                SliverFixedExtentList(
//                  itemExtent: 50, //child的长度或者宽度,取决于滚动方向.
//                  delegate: SliverChildBuilderDelegate((context, int index) {
//                    print(content.mainPost);
//                    Container _piece;
//                    if (index == 0){
//                      _piece = Container(
//                        child: Text(‘dsssouu‘,style: TextStyle(color: Colors.black),),
//                      );
//                    }else{
//                      _piece = Container(
//                        child: Text(‘aaaa‘, style: TextStyle(color: Colors.grey),),
//                      );
//                    }
//                    return _piece;
//                  },
//                    childCount: 20,
//                  ),
//                ),

            ],
            ),

  

SliverList , SliverFixedExtentList

标签:count   scroll   pos   turn   highlight   高度   tom   ack   uil   

原文地址:https://www.cnblogs.com/pythonClub/p/10659521.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!