saveEventually method

Future<ParseResponse> saveEventually()

Implementation

Future<ParseResponse> saveEventually() async {
  // save object
  final ParseResponse response = await save();

  if (response.success) {
    // return success response
    return response;
  } else {
    // if have network connection error
    if ((response.error?.message ?? "").contains(keyNetworkError)) {
      // save this object in CoreStore
      await _addThisObjectToParseCoreDataList(keyParseStoreObjects);
    } else {
      return response;
    }
  }
  return response;
}