Skip to content

Commit

Permalink
Fix(post_preview.dart): handle when magicNum is null
Browse files Browse the repository at this point in the history
magicNum == null일 경우 '달성 전'으로 보여주도록 함
  • Loading branch information
sangohkim committed Mar 31, 2024
1 parent 5ecfe27 commit a1df376
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/widgets/post_preview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -259,17 +259,18 @@ class _PostPreviewState extends State<PostPreview> {
return (Platform.isIOS && model.name_type == 2);
}

String defineCommunicationStatus(int magicNum) {
String defineCommunicationStatus(int? magicNum) {
late String status;
if (magicNum == WithSchoolStatus.beforeUpVoteThreshold.index) {
status = "달성 전";
} else if (magicNum == WithSchoolStatus.beforeSchoolConfirm.index) {
status = "답변 대기 중";
status = "답변 준비 중";
} else if (magicNum == WithSchoolStatus.answerDone.index) {
status = "답변 완료";
} else {
debugPrint("with-school status: undefined status ${magicNum}");
status = "Unknown";
// 위 경우에 해당하지 않는 경우에는 우선 '달성 전'으로 표기
debugPrint("with-school status: undefined status $magicNum");
status = "달성 전";
}

return status;
Expand Down

0 comments on commit a1df376

Please sign in to comment.