selectFriends method

Future selectFriends({
  1. required PickerFriendRequestParams params,
  2. BuildContext? context,
})

여러 명의 친구를 선택(멀티 피커)할 수 있는 친구 피커를 화면에 표시합니다.

Implementation

Future selectFriends({
  required PickerFriendRequestParams params,
  BuildContext? context,
}) async {
  if (await TokenManagerProvider.instance.manager.getToken() == null) {
    throw KakaoClientException(
      ClientErrorCause.tokenNotFound,
      'You must log in before using FriendPicker.',
    );
  }

  var exception = _isParameterCorrect(params);

  if (exception != null) {
    throw exception;
  }

  if (kIsWeb) {
    try {
      return await _invokeWebPicker(params, 'multiple');
    } catch (e) {
      rethrow;
    }
  }

  if (context == null) {
    throw KakaoClientException(
      ClientErrorCause.badParameter,
      'FriendPicker requires context.',
    );
  }

  return await _navigateToWebView(context: context, params: params);
}