Flutter CustomScrollView 的使用 及 常用的Sliver系列组件

编程入门 行业动态 更新时间:2024-10-23 12:33:03

Flutter CustomScrollView 的使用 及 常用的Sliver系列<a href=https://www.elefans.com/category/jswz/34/1771375.html style=组件"/>

Flutter CustomScrollView 的使用 及 常用的Sliver系列组件

文章目录

    • CustomScrollView简介
    • CustomScrollView 一"码"当先
    • Sliver的概念
    • SliverList和SliverGrid
      • SliverChildListDelegate
      • SliverChildBuilderDelegate
      • SliverFixedExtentList
      • SliverGrid
        • SliverGridDelegateWithFixedCrossAxisCount
        • SliverGridDelegateWithMaxCrossAxisExtent
      • SliverAnimatedList
      • SliverPersistentHeader
      • SliverAppBar

CustomScrollView简介

CustomScrollView是可以使用Sliver来自定义滚动模型(效果)的组件。它可以包含多种滚动模型。包括header,footer,CustomScrollView可以实现把多个彼此独立的可滑动widget组合起来。

CustomScrollView 一"码"当先

  Widget mCustomScrollView() {return CustomScrollView(slivers: [SliverAppBar(floating: true,title: Text('CustomScrollView Demo'),expandedHeight: 300,flexibleSpace: Imagework(",1869926726&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500",fit: BoxFit.cover,),),SliverList(delegate: SliverChildListDelegate([Container(height: 80,color: Colors.primaries[0],),Container(height: 80,color: Colors.primaries[1],),Container(height: 80,color: Colors.primaries[2],),Container(height: 80,color: Colors.primaries[3],),Container(height: 80,color: Colors.primaries[4],),])),SliverAppBar(pinned: false,expandedHeight: 250.0,backgroundColor: Colors.blue,flexibleSpace: FlexibleSpaceBar(background: Imagework(",1869926726&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500",fit: BoxFit.cover,),),),],

更多推荐

Flutter CustomScrollView 的使用 及 常用的Sliver系列组件

本文发布于:2023-12-04 11:39:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1660792.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:组件   常用   系列   Flutter   CustomScrollView

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!