flutternetwork / WiFiFlutter

Flutter plugin suite for various WiFi services.
https://wifi.flutternetwork.dev
285 stars 177 forks source link

[wifi_iot] connect to iot device help needed #384

Closed Bojan227 closed 5 months ago

Bojan227 commented 5 months ago
 final response = await WiFiForIoTPlugin.connect(
        connectionInfoDto.ssid,
        joinOnce: true,
      );

      log('$response --- response');

      await Future.delayed(Duration(seconds: 5));

      if (!response) {
        return false;
      } else {
        return await WiFiForIoTPlugin.forceWifiUsage(true);
      }

I'm trying to connect to my iOT device first which is successful, after connection to the iot device wifi network I need to make PUT request to the iOT server. I was wondering why my process is successful if I add delay of 5 second? How to avoid relying on the Feature.delay. Thank you :)