updateDocument<ID extends Object?> method

  1. @override
Future<void> updateDocument<ID extends Object?>(
  1. String collectionPath,
  2. ID documentId,
  3. Map<String, Object?> data
)
override

Updates data on the document. Data will be merged with any existing document data.

If no document exists yet, the update will fail.

Implementation

@override
Future<void> updateDocument<ID extends Object?>(
    String collectionPath, ID documentId, Map<String, Object?> data) async {
  return Dio()
      .patch('$endpoint/$collectionPath/$documentId',
          data: data, options: requestOptions)
      .then((response) => response.data);
}