initApiCall method

  1. @override
Future<bool> initApiCall()
override

Implementation

@override
Future<bool> initApiCall() async {
  if (!widget.isVisible) {
    return false;
  }
  AccessPointConfig? response = await LogbotSetupApiManager.network
      .getAccessPointConfig(uuidToken: LogbotSetupEnv().deviceId);
  formData = {
    "connection": {
      "id": response?.connection.id ?? "",
      "security": response?.connection.security?.value ??
          ConnectionAPSecurity.NONE.value,
      "channel": response?.connection.channel ?? 6,
      "band": response?.connection.band ?? ConnectionAPBand.n2period4.value,
    },
    "security": {
      "password": response?.security?.password ?? "",
    },
    "ipv4": {
      "address": response?.ipv4?.address ?? "",
      "prefix": response?.ipv4?.prefix ?? 24,
    }
  };
  return true;
}