I am creating a Flutter app that allows a user to have multiple accounts. When the user logout via the app it will bring them to a login screen which they can login to another account. The issue i am seeing is the firebase is pulling in the new account data and merging it with the previous account data. I am assuming that the listeners were not disconnected which cause the issue. How do I reset the Firebase listeners similar to the user opening the app? Below is an example of my listener I have. Thanks for any help or suggestions.
FirebaseDatabase.instance
.reference()
.child("accounts")
..onChildAdded
.listen((event) => OnAddedAction(event)))
..onChildChanged
.listen((event) => OnChangedAction(event)))
..onChildRemoved
.listen((event) => OnRemovedAction(event)))));