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

A different SOLUTION for those who have problems with events #56

Open
vk-573 opened this issue Mar 21, 2020 · 1 comment
Open

A different SOLUTION for those who have problems with events #56

vk-573 opened this issue Mar 21, 2020 · 1 comment

Comments

@vk-573
Copy link

vk-573 commented Mar 21, 2020

The events are not triggerred for me for X reasons, but I found a solution for my use case and since I'm not the only one here with this problem...

only for thoses who got TextField(s) in your business logic
You can check if the keyboard is visible or not by the NodeFocus.hasFocus property of your TextField
which have aswell a listener.

YourNodeFocus.addListener(() { print("Has focus: " + _nodeName.hasFocus.toString()); if (YourNodeName.hasFocus) { // keyboard visible } else { // keyboard hidden } });

Scotch solutions.

ref:
https://stackoverflow.com/questions/47965141/how-to-listen-focus-change-in-flutter

@emvaized
Copy link

emvaized commented Jun 8, 2020

I fount the Focus() implementation easier:

Focus(
  child: TextFormField(...),
  onFocusChange: (hasFocus) {
    if(hasFocus) {
      // do staff
    }
  },
)

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

2 participants