Skip to content

lshrinkWrap:计算组件的高度 physics:禁用ListView的滑动

dart
Widget build(BuildContext context) {
    return SafeArea(
        child: SingleChildScrollView(
      child: Column(children: [
        //第一部分:banner
        _banner(),
        //第二部分:ListView
        ListView.builder(
          itemBuilder: (context, index) {
            return _listItemView();
          },
          shrinkWrap: true,
          physics: const NeverScrollableScrollPhysics(),
          itemCount: 10,
        )
      ]),
    ));
  }