convertToContentDto method
- {required Content content}
override
Implementation
@override
LearningContentDto convertToContentDto({
required Content content,
}) {
if (content.id == null ||
content.orderId == null ||
content.chapterId == null ||
content.completionFlag == null ||
content.contentTitle == null ||
content.contentDetails == null) {
throw Exception('学習コンテンツ詳細が不正です');
}
return LearningContentDto(
contentId: content.id!,
orderId: content.orderId!,
contentTitle: content.contentTitle!,
contentNumber: content.orderId!,
isCompleted: content.completionFlag!,
contentDetail: convertToContentDetailDto(
details: content.contentDetails!,
),
);
}