Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working when back and navigate again to current screen #8

Closed
helloimfrog opened this issue Feb 14, 2019 · 1 comment
Closed

Not working when back and navigate again to current screen #8

helloimfrog opened this issue Feb 14, 2019 · 1 comment

Comments

@helloimfrog
Copy link

For example: It works normally in screen 2, but when back to previous screen and navigate again to screen 2, it can't detect if keyboard show or hide anymore. :<

@helloimfrog
Copy link
Author

I've found the solution for this problem: removeListener on dispose()
For Example:
var keyboardVisibilityNoti = KeyboardVisibilityNotification();
var keyboardVisibilityNotiId = keyboardVisibilityNoti.addNewListener(onShow: () {
_hideEmojiChooser();
isKeyboardShowing = true;
}, onHide: () {
isKeyboardShowing = false;
});

and in disspose:
@OverRide
void dispose() {
keyboardVisibilityNoti.removeListener(keyboardVisibilityNotiId);
super.dispose();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant