FLUTTER ECOSYSTEM

fluttercandies/extended_nested_scroll_view

扩展嵌套滚动视图以解决以下问题:1. 固定的滑动标题栏问题;2. 标签页视图中内部可滚动组件的同步问题;3. 下拉刷新功能无法工作;4. 在 NestedScrollView 的主体部分无需使用 ScrollController。

extended_nested_scroll_view 项目封面
Stars
654
Forks
134
最近推送(UTC)
2025年4月20日
项目状态
未归档
FlutterCandies GitHub avatar
GITHUB Organization

FlutterCandies ↗

Custom Flutter candies (packages) for you to build your Flutter app easily. Enjoy it!

语言DartRuby

技术话题

此仓库发布的插件

使用的依赖

依赖清单 2 项

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 README

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

Example for issue 1

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;
        }
       )   ,
       

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

ExtendedVisibilityDetector

Provide ExtendedVisibilityDetector to point out which list is visible

   ExtendedVisibilityDetector(
      uniqueKey: const Key('Tab1'),
      child: ListView(),
   )

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

  • pinned header height

    show how to change pinned header height dynamically.