Open himeshps opened 1 month ago
This pull request addresses a bug in the snackbar functionality related to network connection status. The fix involves modifying the NetworkController class to store the state of the Snackbar and implement a conditional check before toggling its visibility.
classDiagram
class NetworkController {
+bool isSnackBarOpen
+void checkNetworkStatus()
+void toggleSnackBar()
}
NetworkController : +bool isSnackBarOpen
NetworkController : +void checkNetworkStatus()
NetworkController : +void toggleSnackBar()
Change | Details | Files |
---|---|---|
Modified NetworkController class to fix snackbar issue |
|
lib/network/network_controller.dart |
@bmerchant22 @yashlm can you please review this and merge?
I think we need to change the way we check connectivity, you can have a look on this question
Description
It turns out that the issue was due to the time sensitivity of Get.isSnackBarOpen , which made it ocassionally miss the rapid toggling of the network connection and hence, persisting with the wrong pop-up even when connected to a network. I've tried fixing the issue by storing the state of the Snack Bar and a conditional check before sending the next command to close or open the pop-up again which avoids any such bug.
Related Issue
I believe it is a very specific issue and there are not any related issues as such. (https://github.com/pclubiitk/IITK-Mail-Client/issues/69)
Motivation and Context
I have explained this above briefly. It solves the problem arising due to the time sensitivity of the previous function used.
Types of changes
Checklist:
Summary by Sourcery
Fix the snackbar issue by implementing a state management solution to handle rapid network connection toggling, ensuring the correct snackbar state is displayed.
Bug Fixes: