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
Receive Event two times #29
Comments
Your |
HI @marcojakob Can please help me? Thanks with best regards, |
Just include this line somewhere in the program and don't call it multiple times (except if you want to listen to it in multiple components):
|
HI @marcojakob Thanks with best regards, |
i think install the eventBus.on on initState() cause problem... in my case i put in the initState() and when push to another pageFlutter the initState() is calling again my eventBus.on. |
@xhidnoda I don't have experience with Flutter. But I know there is a |
Ok i declare this:
Add listener like this in initState() :
In dispone():
But is not working..what is wrong? please help! |
Sorry @xhidnoda. I can't provide much support here. But you should try debugging your application (or use logging) to see how many times you are registering for the same event. |
Sorry error of my code. I called |
call |
Hi @marcojakob
I'm using event_bus: ^1.1.0 in flutter.
From one page i'm fire event like eventBus.fire(CustomEvents.START_MEDIA_SYNC_EVENT);
and i'm listening event like
void getObserverData() {
eventBus.on().listen((event) => {print(event.toString())});
}
getObserverData() method is called from second screen build method.
I got the events two times.
I initialize bus like this EventBus eventBus = new EventBus(); in one dart file.
Can please help me?
Thanks with best regards,
Sumit Bhondave.
The text was updated successfully, but these errors were encountered: