scanResults method

void scanResults(
  1. dynamic callback(
    1. bool isCompleted
    )
)

Implementation

void scanResults(Function(bool isCompleted) callback) {
  String api = "$searchScanResult$jobId";
  UnitsForNetwork.getHttpForDevice(api, parameters: {}, onSuccess: (res) {
    if (res["status"] == 'COMPLETE') {
      Navigator.pop(currentContext!);
      Map map = res["_links"]["enclosure"];
      locPath = map["href"];

      callback(true);
    } else {
      callback(false);
    }
  });
}