即使在用 SingleChildScrollView() 包装 column() 之后也无法在小部件上滚动

Unable to scroll on widget even after wrapping column() with SingleChildScrollView()

这是根小部件。该小部件有一个子 BuyerPostList(),它是 ListView 类型的小部件。我删除 SingleChildScrollView() 会出现渲染异常。添加后错误不再出现,但页面仍然不可滚动。

class PostsPage extends StatelessWidget {
  final AuthService _auth = AuthService();
  @override
  Widget build(BuildContext context) {
    return StreamProvider<List<BuyerPost>>.value(
        value: BuyerDatabaseService().buyerPosts,
    child:Scaffold(
      backgroundColor: Colors.white,
      appBar: header(context,isAppTitle: true),
        body:Container(
            child: SingleChildScrollView(
              child: Column(
                children: <Widget>[
                  BuyerPostList(),
                  SizedBox(height: 100,),
                ],
              ),
            ),
        ),
      floatingActionButton: FloatingActionButton.extended(
        onPressed: () {
          Navigator.push(
            context,
            MaterialPageRoute(builder: (context) => NewPost()),
          );
        },
        label: Text(
          'New',
          style: TextStyle(fontWeight:FontWeight.w900,color:Color.fromRGBO(0, 0, 0, 0.4),),
        ),
        icon: Icon(Icons.add,color:Color.fromRGBO(0, 0, 0, 0.4),),
        backgroundColor:Colors.white,
      ),
    ),
    );
  }
}


这是列表视图 BuyerPostList 小部件()

class BuyerPostList extends StatefulWidget {
  @override
  _BuyerPostListState createState() => _BuyerPostListState();
}

class _BuyerPostListState extends State<BuyerPostList> {
  @override
  Widget build(BuildContext context) {

    final posts = Provider.of<List<BuyerPost>>(context) ?? [];
    return ListView.builder(
      shrinkWrap: true,
      itemCount: posts.length,
      itemBuilder: (context, index) {
        return BuyerPostTile(post: posts[index]);
      },
    );
  }
}

我希望我的解释已经足够清楚了。我将如何使其可滚动? 提前致谢。

ListView.builder(

里面添加physics: NeverScrollableScrollPhysics(),

代码:

@override
  Widget build(BuildContext context) {

    final posts = Provider.of<List<BuyerPost>>(context) ?? [];
    return ListView.builder(
      shrinkWrap: true,
      physics: NeverScrollableScrollPhysics(),
      itemCount: posts.length,
      itemBuilder: (context, index) {
        return BuyerPostTile(post: posts[index]);
      },
    );
  }