Search packages, repositories and app categories

Package detailsv0.4.0+2

visibility_detector

A widget that detects the visibility of its child and notifies a callback.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
159K
Likes
1.3K
Pub points
140

Install package

flutter pub add visibility_detector

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The visibility_detector package provides a widget that monitors whether its child is visible on the screen. It triggers a callback when the child enters or exits the viewport, enabling efficient rendering and performance optimization. Ideal for lazy loading content, animations, or tracking user engagement with specific UI elements. The package supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux, making it highly versatile for cross-platform applications.

Use cases

  • Lazy loading images or lists
  • Tracking user engagement with content
  • Optimizing animations based on visibility
  • Reducing resource usage for off-screen widgets
  • Implementing infinite scroll with visibility checks

Key features

  • Real-time visibility detection
  • Cross-platform compatibility
  • Customizable visibility thresholds
  • Callback on visibility change
  • Lightweight and efficient

Suitable for

  • Developers optimizing app performance
  • Apps with large scrollable lists
  • Interactive UIs requiring visibility feedback
  • Content-heavy applications like news feeds or galleries
  • Projects needing precise control over rendering timing

Considerations

  • May impact performance if overused in complex trees
  • Requires careful handling of callbacks to avoid memory leaks
  • Visibility threshold settings may need tuning for different use cases
  • Not suitable for detecting absolute screen position without additional logic
  • Limited to visible area within current viewport

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

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.

Categories

Source repository

Projects using this package