get method

Reads the collection referenced by this CollectionReference from the server.

If no collection exists on the server (yet), this local CollectionReference is returned.

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();
}