I am currently using Firebase Realtime Database in a Flutter web and mobile application. I have encountered an issue with the onValue stream that I would like to bring to your attention.
Firstly, I am monitoring the connection status using the following code:
dart
This code always indicates that the connection is established successfully. However, when using an Android phone, if the screen is turned off and then back on, such as when the device is locked and unlocked, the stream attached to onValue experiences a significant delay of up to 30 seconds before reconnecting.
Here is the relevant code snippet:
dart
Despite the connection status indicating no issues, the stream does not function properly. I would appreciate your assistance in understanding the reason behind this inconsistent behavior and any potential solutions or workarounds.