繁体   English   中英

Stack 内部的 ListView 内部的 SingleChildScrollView

[英]ListView inside Stack Inside SingleChildScrollView

我需要滚动整个屏幕,我正在使用(单个子滚动视图 => 堆栈 => ListView.builder)。 但没有滚动。 但是我正在使用:

shrinkWrap: true, 物理: NeverScrollableScrollPhysics(),

代码是:

return Scaffold(
      body: LayoutBuilder(builder: (context, constraints) {
        return SingleChildScrollView(
          physics: BouncingScrollPhysics(),
          child: Container(
            height: constraints.maxHeight,
            child: Stack(children: <Widget>[
              Container(color: Colors.red,height: 300,),
              Container(
                margin: EdgeInsets.only(
                  top: screen.isPhone ? 150 : 240,
                ),
                child: Column(
                  children: [
                    Card(
                      elevation: 5,
                      child: ListView.builder(
                        itemCount: 20,
                        shrinkWrap: true,
                        physics: NeverScrollableScrollPhysics(),
                        itemBuilder: (context, index) =>
                            ProductItemWidget(showDeleteIconButton: true),
                      ),
                    ),
                   Text("HEY"),
                  ],
                ),
              ),

删除高度:constraints.maxHeight,

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM