update<DataT extends Data> method

Future<String?> update<DataT extends Data>(
  1. DataT? data, {
  2. Data? caller,
  3. bool forceUpdate = false,
})

updates a DataT and returns the response

Implementation

Future<String?> update<DataT extends Data>(
  DataT? data, {
  Data? caller,
  bool forceUpdate = false,
}) async {
  //offline procedure, needs some stuff changed and added..
  debugPrint(data.toString());
  if (
      // (forceUpdate ||
      //       caller != null ||
      //       typeOf<DataT>() == typeOf<InspectionLocation>()) &&
      data != null) {
    await storeData<DataT>(data, forId: caller?.id ?? await API().rootID);
    return 'success';
  }
  return null;
}