Afterwards you should assign a GlobalKey, like _drawerKey for instance, to the Drawer widget, after which you would be able to detect when the drawer is closed like this:
1 2 3 4 5 6 7 8 9 | VisibilityDetector( key: _drawerKey, child: Container(), onVisibilityChanged: (info) { if (info.visibleFraction == 0.0) { // drawer not visible. } }, ) |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.