ConnectionCheckerService #2186
Unanswered
CY-ChenWeiXin
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Future<bool> get isConnected async { final connected = await _isConnected(); isConnectedSync = connected; if (connected != isConnectedSync /*previous value*/) { _connectionStreamController.add(connected); } return connected; }
The isConnectedSync variable seems to serve as a cache for the connectivity state, but it's being set and read almost immediately within the isConnected method. This suggests that the variable might be redundant, as its value is not being used for any meaningful state management or decision-making between calls to isConnected.
Beta Was this translation helpful? Give feedback.
All reactions