From a1df3764aefb4e8e99e144c4d782fde01282cf43 Mon Sep 17 00:00:00 2001 From: Sang-oh Kim Date: Mon, 1 Apr 2024 00:47:54 +0900 Subject: [PATCH] Fix(post_preview.dart): handle when magicNum is null MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit magicNum == null일 경우 '달성 전'으로 보여주도록 함 --- lib/widgets/post_preview.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/widgets/post_preview.dart b/lib/widgets/post_preview.dart index 3e1d606a..005f91fb 100644 --- a/lib/widgets/post_preview.dart +++ b/lib/widgets/post_preview.dart @@ -259,17 +259,18 @@ class _PostPreviewState extends State { 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;