搜尋套件、儲存庫與 APP 分類

套件詳情v0.4.0+2

visibility_detector

一個檢測其子組件可見性的組件,並通知回調。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
15.9萬
喜歡數
1270
Pub 分數
140

安裝套件

flutter pub add visibility_detector

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

visibility_detector 套件提供了一個監視其子組件是否在螢幕上可見的元件。當子組件進入或離開畫面範圍時,會觸發回呼,以實現高效渲染與效能最佳化。非常適合用於懶加載內容、動畫,或追蹤使用者對特定 UI 元素的參與度。此套件支援所有主要平台,包括 Android、iOS、Web、macOS、Windows 與 Linux,讓跨平台應用具有高度的彈性。

適用情境

  • 懶加載圖像或列表
  • 追蹤使用者對內容的參與度
  • 根據可見性優化動畫
  • 減少離屏小部件的資源使用
  • 實作具有可見性檢查的無限捲動

主要特色

  • 即時可見性檢測
  • 跨平台相容性
  • 可自訂的可見性閾值
  • 可見性變更回呼
  • 輕量且高效

適合對象

  • 開發者優化應用效能
  • 包含大型可滾動列表的應用
  • 需要可見性反饋的互動式UI
  • 內容密集型應用,如新聞動態或圖庫
  • 需要對渲染時間進行精確控制的項目

使用建議

  • 如果在複雜樹中過度使用,可能會影響效能
  • 需要仔細處理回呼以避免記憶體洩漏
  • 可見性閾值設定可能需要針對不同使用案例進行調整
  • 在沒有額外邏輯的情況下,不適合用於檢測絕對螢幕位置
  • 限制在目前視口內的可見區域

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Build

Flutter widgets

This repository contains the source code for various Flutter widgets that are developed by Google but not by the core Flutter team.

The product and source code here are neither endorsed by Google nor the Flutter team. They are mainly made available as a reference. Support is best-effort.

Packages

Package Description Version
flutter_simple_treeview A widget, that visualises a tree structure, where a node can be any widget. pub package
linked_scroll_controller A scroll controller that allows two or more scroll views to be in sync. pub package
scrollable_positioned_list A list with helper methods to programmatically scroll to an item. pub package
self_storing_input A set of input widgets that automatically save and load the entered value to a data store. pub package
visibility_detector A widget that detects the visibility of its child and notifies a callback. pub package

Issues

Please file any issues, bugs, or feature requests in the this repo.

Contributing

If you wish to contribute a change to any of the existing widgets in this repo, please review our contribution guide, and send a pull request.

所屬分類

原始碼儲存庫

使用此套件的專案