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

插件详情v1.27.3

scrollview_observer

一个用于观察 ScrollView 中显示的子部件相关数据的部件。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
15.3万
喜欢数
325
Pub 分数
160

安装插件

flutter pub add scrollview_observer

插件介绍

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

scrollview_observer 包提供了一个小部件,用于监控并报告 ScrollView 中当前可见的子小部件的数据。它使开发者能够跟踪哪些项目在屏幕上显示、它们的位置以及可见性状态,从而支持基于滚动行为的动态内容加载、分析或 UI 调整。非常适合实现无限列表、性能优化或可滚动界面中的实时反馈。

适合场景

  • 无限滚动与懒加载
  • 用于分析的可见项目跟踪
  • 基于滚动位置的动态UI更新
  • 实时内容渲染优化
  • 基于滚动的动画
  • 长列表中的性能监控

主要特点

  • 实时可见性检测
  • 子部件的位置跟踪
  • 轻量且高效
  • 支持所有 Flutter 平台
  • 与现有 ScrollViews 的简单集成
  • 可自定义的回调触发

适合对象

  • 开发长列表或无限列表的开发者
  • 需要基于滚动逻辑的应用
  • 对性能敏感的应用程序
  • 集成分析的可滚动用户界面
  • 交互式滚动驱动体验

使用建议

  • 如果过度使用,可能会影响性能
  • 需要谨慎处理回调
  • 不适合用于简单的静态列表
  • 仅限直接的 ScrollView 子项
  • 最好与优化的子部件一起使用
  • 许多观察者可能导致内存开销增加

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Flutter ScrollView Observer

author pub stars

Language: English | 中文

This is a library of widget that can be used to listen for child widgets those are being displayed in the scroll view.

☕ Support me

ko-fi wechat

Chat: Join WeChat group

📖 Article

🔨 Feature

You do not need to change the view you are currently using, just wrap a ViewObserver around the view to achieve the following features.

  • [x] Observing child widgets those are being displayed in ScrollView
  • [x] Support for scrolling to a specific item in ScrollView
  • [x] Quickly implement the chat session page effect
  • [x] Support for keeping IM message position when inserting or updating messages, avoiding jitter.

🎀 Support

  • [x] PageView
  • [x] ListView
  • [x] SliverList
  • [x] GridView
  • [x] SliverGrid
  • [x] Mixing usage of SliverPersistentHeader, SliverList and SliverGrid
  • [x] NestedScrollView
  • [x] ScrollView built by third-party package.

🕹 Preview

📦 Installing

Add scrollview_observer to your pubspec.yaml file:

dependencies:
  scrollview_observer: latest_version

Import scrollview_observer in files that it will be used:

import 'package:scrollview_observer/scrollview_observer.dart';

📚 Wiki

🖨 About Me

所属分类

源码仓库

使用此插件的项目