線上直播系統原始碼,flutter 巢狀滑動實現

zhibo系統開發發表於2021-11-03

線上直播系統原始碼,flutter 巢狀滑動實現

class HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
 
        //Image.asset("images/u.png")
        body: NestedScrollView(
      headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
        return <Widget>[
          SliverAppBar(
            expandedHeight: 260,
            pinned: true,
            flexibleSpace: FlexibleSpaceBar(
                collapseMode: CollapseMode.parallax,
                titlePadding: EdgeInsets.only(left: 0),
                title: buildTitle(),
                background: Stack(
                  children: <Widget>[
 
                    Positioned.fill(
                        child: Image.asset(
                          "images/u.png",
                          fit: BoxFit.cover,
                        )),
                    Positioned.fill(child: BlurUtils(singl: 20,)),
                    //Positioned(bottom:200,left: 0,right: 0,top: 20,child:Ziliao()),
                    Align(
                      alignment: Alignment.bottomCenter,
                      child: Ziliao(),
                    )
                    //bioa
 
                  ],
                )),
          )
        ];
      },
      body: ListView.builder(
          itemCount: 20,
          itemBuilder: (Context, index) {
            return ListTile(
              title: Text("${index}"),
            );
          }),
    ));
  }
 
  Widget buildTitle() {
    return Container(
      child: Container(
        margin: EdgeInsets.fromLTRB(20, 0, 0, 50),
        child: Row(
          children: <Widget>[
            ClipRRect(
              borderRadius: BorderRadius.circular(23),
              child: Image.asset(
                "images/u.png",
                width: 50,
                height: 50,
              ),
            ),
            Text("張三")
          ],
        ),
      ),
    );
  }
 
 Widget Ziliao() {
    return Container(
      height: 60,
      alignment: Alignment.center,
      color: Colors.white,
      child: Row(
 
        children: <Widget>[
          titles(),
          titles(),
          titles(),
          titles()
 
        ],
      ),
    );
 }
 Widget titles(){
    return  Expanded(child:
    Column(
      mainAxisAlignment: MainAxisAlignment.center,
      children: <Widget>[
        Text("3"),
        Text("收藏")
      ],
    ));
 }
}

以上就是 線上直播系統原始碼,flutter 巢狀滑動實現,更多內容歡迎關注之後的文章


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69978258/viewspace-2840405/,如需轉載,請註明出處,否則將追究法律責任。

相關文章