connectToHotspot method
Initiates a connection attempt to a Wi-Fi Direct hotspot using the provided credentials.
ssid
: The network name (SSID) of the target hotspot.psk
: The password (Pre-Shared Key) of the target hotspot. Listen to streamHotspotClientState for connection status updates. Returns a Future that completes when the connection attempt is initiated.
Implementation
@override
Future<void> connectToHotspot(String ssid, String psk) async {
await methodChannel.invokeMethod(
'connectToHotspot',
{'ssid': ssid, 'psk': psk},
);
}