Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter equivalents to `View::onAttachedToWindow` and `View::onDetachedFromWindow`

What are Flutter equivalents to Android's View::onAttachedToWindow and View::onDetachedFromWindow?

Basically, in Flutter, how to determine if user can see a particular widget on screen or is it covered, for example, with another screen on top?

like image 793
Alexey Dmitriev Avatar asked Oct 16 '18 09:10

Alexey Dmitriev


1 Answers

Flutter seem to have limited lifecycle events. Maybe what you're looking for can be achieved by overriding initState() and deactivate(). Checkout widget lifecycle here for more info

like image 100
maker.jr Avatar answered Nov 09 '22 13:11

maker.jr