dart – 如何在flutter中实现Alphabet滚动

前端之家收集整理的这篇文章主要介绍了dart – 如何在flutter中实现Alphabet滚动前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
是否有任何插件方法来实现这种滚动?

contacts list iamge

解决方法

检查这个插件粘头
https://pub.dartlang.org/packages/sticky_headers

class Example extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new ListView.builder(itemBuilder: (context,index) {
      return new StickyHeader(
        header: new Container(
          height: 50.0,color: Colors.blueGrey[700],padding: new EdgeInsets.symmetric(horizontal: 16.0),alignment: Alignment.centerLeft,child: new Text('Header #$index',style: const TextStyle(color: Colors.white),),content: new Container(
          child: new Image.network(imageForIndex(index),fit: BoxFit.cover,width: double.infinity,height: 200.0),);
    });
  }
}

猜你在找的Flutter相关文章