项目作者: fluttercandies

项目描述 :
extended nested scroll view to fix following issues. 1.pinned sliver header issue 2.inner scrollables in tabview sync issue 3.pull to refresh is not work. 4.do without ScrollController in NestedScrollView's body
高级语言: Dart
项目地址: git://github.com/fluttercandies/extended_nested_scroll_view.git
创建时间: 2019-02-14T14:34:49Z
项目社区:https://github.com/fluttercandies/extended_nested_scroll_view

开源协议:MIT License

下载


extended_nested_scroll_view

pub package GitHub stars GitHub forks GitHub license GitHub issues FlutterCandies QQ 群

Language: English | 中文简体

NestedScrollView: extended nested scroll view to fix following issues.

1.pinned sliver header issue

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

  1. var tabBarHeight = primaryTabBar.preferredSize.height;
  2. var pinnedHeaderHeight =
  3. //statusBar height
  4. statusBarHeight +
  5. //pinned SliverAppBar height in header
  6. kToolbarHeight;
  7. ExtendedNestedScrollView(
  8. pinnedHeaderSliverHeightBuilder: () {
  9. return pinnedHeaderHeight;
  10. }
  11. ) ,

Example for issue 2

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.
  1. ExtendedNestedScrollView(
  2. onlyOneScrollInBody: true,
  3. )

ExtendedVisibilityDetector

Provide ExtendedVisibilityDetector to point out which list is visible

  1. ExtendedVisibilityDetector(
  2. uniqueKey: const Key('Tab1'),
  3. child: ListView(),
  4. )

Do without ScrollController in NestedScrollView’s body

  • due to we can’t set ScrollController for list in NestedScrollView’s body(it will breaking behaviours of InnerScrollController in NestedScrollView),provide Demos

  • pull to refresh

  • load more

  • scroll to top

    show how to do it without ScrollController