request static method

Future request(
  1. String userId,
  2. {Map<String, dynamic>? attributes}
)

Implementation

static Future request(String userId,
    {Map<String, dynamic>? attributes}) async {
  LCUser? user = await LCUser.getCurrent();
  if (user == null) {
    throw new ArgumentError('Current user is null.');
  }
  String path = 'users/friendshipRequests';
  LCObject friend = LCObject.createWithoutData('_User', userId);
  await LeanCloud._httpClient.post(path,
      data: {'user': _LCEncoder.encodeLCObject(user), 'friend': _LCEncoder.encodeLCObject(friend), 'friendship': attributes});
}