friends method

Future<FriendsResponse> friends ({int offset, int limit, String order })

Fetches a list of current user's KakaoTalk friends.

However, not all friends are returned by this API. They are filtered by the following criteria:

  1. Connected to the application
  2. Agreed to use Friends API in /oauth/authorize.

Implementation

Future<FriendsResponse> friends({int offset, int limit, String order}) async {
  return ApiFactory.handleApiError(() async {
    var params = {
      "offset": offset,
      "limit": limit,
      "order": order,
      "secure_resource": true
    };
    params.removeWhere((k, v) => v == null);
    Response response =
        await _dio.get("/v1/friends", queryParameters: params);
    return FriendsResponse.fromJson(response.data);
  });
}