exposure 1.0.2 copy "exposure: ^1.0.2" to clipboard
exposure: ^1.0.2 copied to clipboard

outdated

Sensor widget for flutter that notifies you when it is exposured

Exposure Widget #

This is a widget that can automatically monitor whether the child widget is exposed
When the child widget is found in the window viewport, it begin detecting
When stay time exceeds the exposure time condition (default is 0.5s) and the exposure area is greater than the visibility fraction condition (default 50%)
It will trigger the exposure callback and record the Key value in a queue (the default is to store up to 100 keys). Encounter the same key in the queue, no more exposure detection

install #

Add this to your package's pubspec.yaml file

dependencies:
  exposure: ^1.0.2

use #

ExposureDetector({
    key: Key('exposure'),  // Custom Key
    child: childWidget, //Child Widget
    exposure: callBack // Exposure Callback
});

Examples

Scroll List Exposure

scroll Exposure

Animate Exposure

animateExposure

Dialog Exposure

dialogExposure

Configuration #

  • ExposureDetectorController.instance.setFilterList:Function Set key queue
  • ExposureDetectorController.instance.exposureTime:int Set exposure time condition (ms)
  • ExposureDetectorController.instance.exposureFraction:double Set visibility fraction condition
  • ExposureDetectorController.instance.updateInterval:Duration Set delay detection time
5
likes
0
pub points
8%
popularity

Publisher

unverified uploader

Sensor widget for flutter that notifies you when it is exposured

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, toast

More

Packages that depend on exposure