get method

Reads the collection referenced by this CollectionReference from the server, and updates id and path.

Returns this reference. Throws a CarpServiceRequestException if the collection does not exist on the server.

Implementation

Future<CollectionReference> get() async {
  final response = await service._get(collectionUri);
  Map<String, dynamic> responseJson = service._handleResponse(response) as Map<String, dynamic>;

  return this
    .._id = responseJson['id'] as int
    .._path = responseJson['name'].toString();
}