focus_detector 0.0.1 copy "focus_detector: ^0.0.1" to clipboard
focus_detector: ^0.0.1 copied to clipboard

outdated

Wrapper around Google's [VisibilityDetector](https://github.com/google/flutter.widgets/tree/master/packages/visibility_detector) for combining it with Flutter's WidgetsBindingObserver in order to achi [...]

FocusDetector #

Wrapper around Google's VisibilityDetector for combining it with Flutter's WidgetsBindingObserver in order to achieve Android's onResume/onPause and iOS's viewDidAppear/viewDidDisappear on Flutter.

How Does it Work? #

A FocusDetector widget takes in a child and optional onFocusGained/onFocusLost callbacks and fires those as the widget's focus changes. Some cases that trigger the focus change:

  1. When the widget is first created;
  2. When its route is popped back to;
  3. When the app is sent to background/foreground while the widget was visible;

Article #

https://edsonbueno.com

Sample #

Check out the set-state-focus-detector or bloc-focus-detector branch of the Breaking Bapp repository.

338
likes
20
pub points
98%
popularity

Publisher

verified publisheredsonbueno.com

Wrapper around Google's [VisibilityDetector](https://github.com/google/flutter.widgets/tree/master/packages/visibility_detector) for combining it with Flutter's WidgetsBindingObserver in order to achieve Android's onResume/onPause and iOS's viewDidAppear/viewDidDisappear on Flutter.

Homepage

License

BSD-3-Clause (license)

Dependencies

flutter, visibility_detector

More

Packages that depend on focus_detector