fluttercommunity / plus_plugins

Flutter Community Plus Plugins
BSD 3-Clause "New" or "Revised" License
1.5k stars 881 forks source link

[Question]: [Connectivity_Plus] If user have their W-Fi feature on, But didn't connected to any network. ConnectivityResult enum will return as either mobile or none. Is this expected behavior? #3021

Open famasf1 opened 3 weeks ago

famasf1 commented 3 weeks ago

What is your question?

I'm trying to check whether or not user already turned Wi-Fi on or not. Without having to connect to any Wi-Fi connection prior.

Future<List<ConnectivityResult>> isWifiOn() async {
    return await connectivity.checkConnectivity();
  }

However, this code will always return as either ConnectivityResult.mobile or ConnectivityResult.none and will not change unless i connected to atleast 1 Wi-Fi spot. I'm not sure if this is expected behavior since my understanding is that it always detecting based on wifi service itself and not the connection.

Checklist before submitting a question

vbuberen commented 3 weeks ago

Plugin doesn't tell if the service is on/off, so this is expected behavior.