extended_nested_scroll_view
고정된 헤더와 내부 스크롤 가능한 요소의 동기화 문제를 해결하기 위해 중첩 스크롤 뷰를 확장했습니다.
다음 문제를 해결하기 위해 확장된 중첩 스크롤 뷰를 사용합니다. 1. 고정된 슬라이버 헤더 문제; 2. 탭뷰 내부의 내부 스크롤 가능한 요소의 동기화 문제; 3. 풀 투 리프레시가 작동하지 않음; 4. NestedScrollView 본문에서 ScrollController 없이 작동
{"sdk":"flutter"}^0.4.0+2아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
pub package GitHub stars GitHub forks GitHub license GitHub issues FlutterCandies QQ 群
NestedScrollView: extended nested scroll view to fix following issues.
2.inner scrollables in tabview sync issue
3.do without ScrollController in NestedScrollView's body
Web demo for ExtendedNestedScrollView
give total height of pinned sliver headers in pinnedHeaderSliverHeightBuilder callback
var tabBarHeight = primaryTabBar.preferredSize.height;
var pinnedHeaderHeight =
//statusBar height
statusBarHeight +
//pinned SliverAppBar height in header
kToolbarHeight;
ExtendedNestedScrollView(
pinnedHeaderSliverHeightBuilder: () {
return pinnedHeaderHeight;
}
) ,
We usually keep list scroll position with following:
| scene | onlyOneScrollInBody | description |
|---|---|---|
| AutomaticKeepAliveClientMixin | true | ScrollPosition will not be disposed, set onlyOneScrollInBody to true so that we can know which list is isActived. |
| PageStorageKey | false | ScrollPosition will be disposed, PageStorageKey just record the position info,the scroll positions in ExtendedNestedScrollView will always single one. |
ExtendedNestedScrollView(
onlyOneScrollInBody: true,
)
Provide ExtendedVisibilityDetector to point out which list is visible
ExtendedVisibilityDetector(
uniqueKey: const Key('Tab1'),
child: ListView(),
)
due to we can't set ScrollController for list in NestedScrollView's body(it will breaking behaviours of InnerScrollController in NestedScrollView),provide Demos
show how to do it without ScrollController
show how to change pinned header height dynamically.