2

So, I have a CustomScrollView with a SliverAppBar and a SliverList. The SliverList has multiple non-sliver children widgets.

CustomScrollView(
  slivers: [
    SliverAppBar(title: Text('some title')),
    SliverList(
      delegate: SliverChildListDelegate(
        [
          // non sliver children
        ],
      ),
    ),
  ],
);

I want the content (non sliver children) of the CustomScrollView to have pull down to refresh. I don't want to put the RefreshIndicator on top of the scroll view because that will also reload the SliverAppBar.

I tried wrapping all the non-sliver children with a Column and wrapping that Column in the RefreshIndicator but that didn't work.

How do I do this? Thanks.

IncorrectMouse
  • 179
  • 1
  • 9

1 Answers1

0
U can use like this.
CustomScrollView(
  slivers: [
    CupertinoSliverRefreshControl(
      onRefresh: _refreshData,
    ),
    SliverList(
      delegate: SliverChildBuilderDelegate((context, index) {
        WordPair wordPair = _data[index];
        return _buildListItem(wordPair.asString, context);
      },
      childCount: _data.length,
    ),
  ],
),
ziqq
  • 523
  • 5
  • 11