FLUTTER ECOSYSTEM

fluttercandies/extended_nested_scroll_view

以下の問題を修正するために、ネストされたスクロールビューを拡張します。1. 固定スライバーのヘッダー問題;2. タブビュー内の内側のスクロール可能なコンポーネントの同期問題;3. プル to リフレッシュが機能しない;4. NestedScrollView のボディで ScrollController を使わない。

extended_nested_scroll_view のプロジェクト画像
Stars
654
Forks
134
最終プッシュ(UTC)
2025/04/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.