extended_nested_scroll_view
扩展嵌套滚动视图以修复固定标题和内部可滚动组件的同步问题。
扩展嵌套滚动视图以解决以下问题:1. 固定的滑动标题栏问题;2. 标签页视图中内部可滚动组件的同步问题;3. 下拉刷新功能无法工作;4. 在 NestedScrollView 的主体部分无需使用 ScrollController。
以下为英文项目原文快照,最新内容请访问 GitHub。
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.
依赖清单 2 项
{"sdk":"flutter"}^0.4.0+2先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗