fetch method

Future<ParseObject> fetch({
  1. List<String>? include,
})

Fetches this object with the data from the server. Call this whenever you want the state of the object to reflect exactly what is on the server.

List<String> include refers to other ParseObjects stored as a Pointer

Implementation

Future<ParseObject> fetch({List<String>? include}) async {
  if (objectId == null || objectId!.isEmpty) {
    throw 'can not fetch without a objectId';
  }

  final ParseResponse response = await getObject(objectId!, include: include);

  if (response.success && response.results != null) {
    return response.results!.first;
  } else {
    return this;
  }
}