搜尋套件、儲存庫與 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

所屬分類

原始碼儲存庫

使用此套件的專案