follow method Null safety

Future follow(
  1. String targetId,
  2. {Map<String, dynamic>? attrs}
)

Follows a user whose objectId is targetId.

Implementation

Future follow(String targetId, {Map<String, dynamic>? attrs}) async {
  if (isNullOrEmpty(targetId)) {
    throw ArgumentError.notNull('targetId');
  }
  String path = 'users/self/friendship/$targetId';
  await LeanCloud._httpClient.post(path, data: attrs);
}