addGeotagWithExpectedLocation method Null safety

Future<Result<LocationWithDeviation, LocationError>> addGeotagWithExpectedLocation(
  1. String orderHandle,
  2. OrderStatus orderStatus,
  3. JSONObject data,
  4. Location expectedLocation
)

Adds a new geotag with expected location. Check Shift tracking doc to learn how to use Order handle and Order status params. Accepts:

  • orderHandle - Order handle.
  • orderStatus - Order status.
  • data - Geotag data JSON.
  • expectedLocation - Expected location. Returns current location with deviation from expected location if success or LocationError if failure.

Implementation

static Future<Result<LocationWithDeviation, LocationError>>
    addGeotagWithExpectedLocation(String orderHandle, OrderStatus orderStatus,
        JSONObject data, Location expectedLocation) {
  return _invokeSdkMethod<Map<Object?, Object?>>(
          SdkMethod.addGeotag,
          serializeGeotagData(
              orderHandle, orderStatus, data, expectedLocation))
      .then((value) {
    return deserializeLocationWithDeviationResult(value);
  });
}