Platforms
iOS, Android
Description
custom_refresh_indicator 本身就需要使用physics,并且没有传scrollController的地方
My code
ListViewObserver(
controller: controller.observerController,
child: RefreshIndicatorWidget(
controller: controller.refreshController,
onRefresh: controller.onRefresh,
onLoading: controller.onLoadMore,
builder: (context, physics) => ListView.builder(
physics: physics.applyTo(
ChatObserverBouncingScrollPhysics(
observer: controller.chatObserver)),
controller: controller.scrollController,
padding: EdgeInsets.symmetric(horizontal: 15.w),
itemCount: controller.messageList.length,
itemBuilder: (context, index) {
return _buildMessageItem(index);
},
),
),
RefreshIndicatorWidget 是一个CustomRefreshIndicator封装的 Widget,透出的physics是AlwaysScrollableScrollPhysics(
parent: ClampingWithOverscrollPhysics(state: _controller),
)
Try do it
No response