# friends method Null safety

Future<Friends> friends(

1. {int? offset,
2. int? limit,
3. FriendOrder? friendOrder,
4. Order? order,
5. FriendsContext? context}

)

카카오톡 친구 목록 가져오기

## Implementation

    Future<Friends> friends({
      int? offset,
      int? limit,
      FriendOrder? friendOrder,
      Order? order,
      FriendsContext? context,
    }) async {
      return ApiFactory.handleApiError(() async {
        final params = {
          Constants.offset: context != null ? context.offset : offset,
          Constants.limit: context != null ? context.limit : limit,
          Constants.friendOrder: context != null && context.friendOrder != null
              ? describeEnum(context.friendOrder!)
              : (friendOrder == null ? null : describeEnum(friendOrder)),
          Constants.order: context != null && context.order != null
              ? describeEnum(context.order!)
              : (order == null ? null : describeEnum(order)),
          Constants.secureResource: true
        };
        params.removeWhere((k, v) => v == null);
        final response =
            await _dio.get(Constants.v1FriendsPath, queryParameters: params);
        return Friends.fromJson(response.data);
      });
    }