peng8350 / flutter_pulltorefresh

a widget provided to the flutter scroll component drop-down refresh and pull up load.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add possibility to return RenderSliver instead of _RenderLayoutBuilder

abdullahalamodi opened this issue · comments

when I try to wrap SliverList with SmartRefersher inside CustomScrollView it gives me this error ->
A RenderViewport expected a child of type RenderSliver but received a child of type _RenderLayoutBuilder.
The relevant error-causing widget was
SmartRefresher

so I hope that anyone can customize SmartRefersher with some thing like SliverSmartRefersher to make it possible to add it as a child of CustomScrollView

this is the code that I want to achieve, what's give me the above error

CustomScrollView(
                slivers: [
                  SliverToBoxAdapter(
                    child: UserInfoWidget(
                      user: data,
                    ),
                  ),
                  SliverPersistentHeader(
                    pinned: true,
                    delegate: _PresistentHeaderDelegate(
                      child: const UserProfileTapWidget(),
                    ),
                  ),
                  SmartRefresher(
                    onRefresh: () {},
                    controller: RefreshController(),
                    child: SliverList(
                      delegate: SliverChildBuilderDelegate(
                        (context, index) {
                          return const PostWidget(myPost: true);
                        },
                        childCount: 10,
                      ),
                    ),
                  )
                ],
              ),