stories method Null safety
- [String? lastId]
카카오스토리의 내 스토리 여러 개 가져오기 단, comments, likes 등의 상세정보는 없으며 이는 내스토리 정보 요청 story 통해 획득 가능
Implementation
Future<List<Story>> stories([String? lastId]) async {
return ApiFactory.handleApiError(() async {
final response = await _dio.get(Constants.getStoriesPath,
queryParameters: lastId == null ? {} : {Constants.lastId: lastId});
final data = response.data;
if (data is List) {
return data.map((entry) => Story.fromJson(entry)).toList();
}
throw KakaoClientException("Stories response is not a json array.");
});
}