setWifiState method
Enables or disables the Wi-Fi.
Implementation
Future<void> setWifiState(bool enable) async {
try {
await _methodChannel.invokeMethod('setWifi', {'wifi': enable});
} catch (e) {
throw Exception("Error setting Wi-Fi state: $e");
}
}