-
Notifications
You must be signed in to change notification settings - Fork 142
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
Cant trigger listener in my own code #1
Comments
I made a new project just to try your keyboard :
|
In my pubspec.yaml I have :
It still doesnt work even with that basic example. Is there an android setting in the Manifest or something which is also needed ? |
Hi man, sorry for the late reply, @Rockvole: no, there are no further settings needed. I'll check your example @CosmicPangolin: do you have any further information on what happens on this specific page? Can you provide any example? How are you testing? Android or iOS? |
@Rockvole: I checked your example on Android emulator, it works. Can you provide more information on your set up? |
|
OK, I will have a look |
@adee42 Check out that example. 'SCAFFOLD' never gets printed. From my testing so far, both KeyboardVisibilityNotification constructors run just fine, with _keyboardVisibilitySubscription assigned as 'Instance of _BroadcastSubscription'. However, onChange is never called for the Scaffold class. Interestingly, this issue seems somehow linked to composition...two distinct classes within scaffold (BottomAppBar and some sliver) can have working KeyboardVisibilityNotifications. |
If I see correctly, you have two listeners running at the same time. Only one of them (the latter) is triggered |
OK, I found the bug and fixed it. The new version 0.5.1 is uploaded and ready to use. @CosmicPangolin: You have a bug in your code, though. When you update the page, the TextField loses focus which closes the keyboard But given this is only an example, I believe you will get it fixed in the final application |
Yeaa see the fix, that makes sense. I was over here digging into Broadcast streams being like 'but whyyy wont it take multiple listeners'... :) No doubt on the bug; the actual codebase is full of components and state management...hence the multiple listeners; I really didn't want to have to dispatch actions and juggle a state object for keyboard stuffs. Thanks for the quick work, this was blocking me all morning! |
@CosmicPangolin: Yes, in Flutter only one EventChannel receives the actual message from Android or iOS. That is why I had to use the internal list of listeners to allow multiple listeners. In my own code I used a 'global' variable, that is why I didn't encounter the same problem as you did. I am happy I could help. Enjoy! |
This issue has been open for some time without any updates, please re-open if you still experience it |
Hi,
Thanks for the plugin.
I can see that your example works. When I try to copy / paste the example code into my own code and include your library it doesn't seem to ever call the listener.
In the listener, I just put a print statement to show the $visible value but it never seems to be called.
Is there anything else I need to do to enable it ?
The text was updated successfully, but these errors were encountered: