FLUTTER ECOSYSTEM

visibility_detector

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

Latest version
0.4.0+2
30-day downloads
122.4K
Likes
1.3K
Pub points
140

Package Overview

Selection guidance generated from public package information. For reference only.

Overview

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
Supported platformsAndroidiOSWebmacOSWindowsLinux

Install package

flutter pub add visibility_detector

Categories

Source repository

Related projects