FilledStacks / flutter-tutorials

The repo contains the source code for all the tutorials on the FilledStacks Youtube channel.
MIT License
4.76k stars 1.76k forks source link

kIsWeb not working #101

Closed pallavbohara closed 4 years ago

pallavbohara commented 4 years ago

Hello, It is not working. I am trying like this(In reference to your 'NetWork Aware Code' in connectivity_servie.dart :

ConnectivityStatus _getStatusFromResult(ConnectivityResult result) { if (kIsWeb) { return ConnectivityStatus.Cellular; } switch (result) { case ConnectivityResult.mobile: return ConnectivityStatus.Cellular; break; case ConnectivityResult.wifi: return ConnectivityStatus.Wifi; break; case ConnectivityResult.none: return ConnectivityStatus.Offline; break; default: return ConnectivityStatus.Offline; } }

But It is always picking Offline code. I am attacing whole project zip in case you need.

network_sensitive (2).zip

Originally posted by @pallavbohara in https://github.com/FilledStacks/flutter-tutorials/issues/100#issuecomment-684520808