((!onLeftEdge &&
_ancestor._pageController.offset !=
_ancestor._pageController.position.maxScrollExtent));
}
3.将上层TabBarView的_pageController改变为offset+拖动overscroll的。这样效果就完成了。
_ancestor._pageController.position.moveTo(
_ancestor._pageController.offset +
overscrollNotification.overscroll);
4.如果上层可以滑动,我们需要去掉overscroll的阻尼效果。 首先在增加对OverscrollIndicatorNotification的监听
return NotificationListener(
onNotification: _handleScrollNotification,
child: NotificationListener(
onNotification: _handleGlowNotification,
child: ExtendedPageView(
controller: _pageController,
physics: widget.physics == null
? _kTabBarViewPhysics
: _kTabBarViewPhysics.applyTo(widget.physics),
children: _children,
),
),
);
判断是否上层TabBarView能否滑动
bool _handleGlowNotification(OverscrollIndicatorNotification notification) {
debugPrint