wow_shopping
wow_shopping copied to clipboard
connection_monitor - iOS Simulator - onConnectivityChanged not showing Wifi going off
This is only happening in iOS Simulator. But when you turn off the WiFi onConnectivityChanged still shows WiFifi is turned on instead of off.
- Run the App with WiFi turned on
- Turn off the WiFi on Mac
- onConnectivityChanged still shows 'wifi' instead of 'none' for internet connection
I have tested with my own projects and the onConnectivityChanged is behaving the same way, I believe the issue is with the connectivity_plus plugin.
But if you do the following it works ok but will break again
- Run the App with WiFi turned off
- Turn on the WiFi on Mac (it works)
- Turn off the WifFi on Mac
- onConnectivityChanged still shows 'wifi' instead of 'none' for internet connection
my testing code:
connectionService.connectivity.onConnectivityChanged
.listen((connectivityResult) {
debugPrint('connectivityResult: ${connectivityResult.name}');
});
return StreamBuilder(
initialData: snapshot.requireData,
stream: onConnectivityChanged,
builder: (BuildContext context, AsyncSnapshot<ConnectivityResult> snapshot) {
final result = snapshot.requireData;
return _ConnectivityBannerHost(
isConnected: result != ConnectivityResult.none,
It returns ConnectivityResult..wifi instead of .none
By the way, when you run it on an actual iPhone device it looks like its working fine.
Thanks