小编Dey*_*ora的帖子

为什么 sliverlist 在我的 CustomScrollView 中不起作用?

我正在尝试添加一个 sliverlist 但它对我不起作用,我对使用 flutter 很陌生,我很困惑。

@override
Widget build(BuildContext context) {
return Scaffold(
  body: const CustomScrollView(
    slivers: <Widget>[
      SliverAppBar(
        title: Text('Sample Slivers'),
        leading: Icon(Icons.menu),
        backgroundColor: Colors.orangeAccent,
        expandedHeight: 90.0,
        floating: true,
        pinned: true,
        snap: false,
      ),
      SliverList(
        delegate: SliverChildBuilderDelegate((context) {}),
      )
    ],
  ),
  bottomNavigationBar: _navigatorAppBar(),
  floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
  floatingActionButton: _buildFab(),
);
}
}
Run Code Online (Sandbox Code Playgroud)

图像

flutter flutter-sliver flutter-layout

5
推荐指数
1
解决办法
2666
查看次数

标签 统计

flutter ×1

flutter-layout ×1

flutter-sliver ×1