搜索插件、代码仓与 APP 分类

插件详情v6.2.1

extended_nested_scroll_view

扩展嵌套滚动视图以修复固定标题和内部可滚动组件的同步问题。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
4.4万
喜欢数
315
Pub 分数
140

安装插件

flutter pub add extended_nested_scroll_view

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个 Flutter 包,扩展了内置的 NestedScrollView,以解决固定标题和同步内部滚动视图的常见问题。它确保在使用嵌套滚动视图时具有流畅的滚动行为,特别是当标题保持固定而内部内容滚动时。非常适合具有多个可滚动部分的复杂 UI,如可折叠标题。该包由 fluttercandies.com 维护,并支持所有主要平台,包括移动、Web 和桌面。

适合场景

  • 带有固定标题的复杂布局
  • 嵌套滚动视图中的同步滚动
  • 可折叠标题设计
  • 多部分可滚动界面
  • 自定义滚动协调
  • 具有动态内容的响应式 UI

主要特点

  • 修复固定标题同步问题
  • 支持所有 Flutter 平台
  • 增强的滚动协调
  • 与现有 NestedScrollView 的轻松集成
  • 嵌套滚动的优化性能
  • 扩展原生 NestedScrollView 功能

适合对象

  • 开发高级可滚动 UI 的开发者
  • 可折叠或固定标题的应用程序
  • 需要可靠嵌套滚动行为的团队
  • 跨多个平台的UI密集型应用程序
  • 寻求稳定滚动同步的Flutter开发者

使用建议

  • 需要理解 NestedScrollView 的机制
  • 可能会为简单的滚动情况增加轻微开销
  • 最适合复杂的滚动层次结构
  • 基本可滚动布局不需要
  • 超出滚动同步之外的自定义功能有限

原始 README

以下为关联源码仓库的 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.

所属分类

依赖

依赖清单 1 项

源码仓库

使用此插件的项目