setWifiOnlySync method

Future<void> setWifiOnlySync(
  1. bool wifiOnly
)

Implementation

Future<void> setWifiOnlySync(bool wifiOnly) async {
  try {
    await kruzr_comm.setFileSyncOnlyOnWifi(wifiOnly);
  } on PlatformException catch (e, stackTrace) {
    if (kDebugMode) {
      print("Error in setWifiOnlySync");
      print(stackTrace);
      print(e);
    }
    return Future.error({"code": e.code, "message": e.message, "details": e.details});
  } on Exception catch (e, stackTrace) {
    if (kDebugMode) {
      print("Error in setWifiOnlySync");
      print(stackTrace);
      print(e);
    }
    return Future.error(PlatformException(code: "PLUGIN_ERROR", message: e.toString()));
  }
  return;
}