HOME 퀘스트 줄 분류 · 일시 정지 표기
This commit is contained in:
@@ -71,16 +71,28 @@ class QuestIconBox extends StatelessWidget {
|
||||
};
|
||||
|
||||
/// 일시 정지 표기 — 「카테고리 · 일시 정지 · 43/60」. 카드와 탭 위 캡슐이 같이 쓴다(원장 C-83).
|
||||
String pausedLabel(QuestCard card, {bool title = false}) {
|
||||
final session = card.session;
|
||||
return [
|
||||
if (!title) card.categoryName,
|
||||
appL10n.questPaused,
|
||||
if (title) card.title,
|
||||
if (session != null && session.total > 0)
|
||||
'${formatPop(session.progress)}/${formatPop(session.total)}',
|
||||
].join(' · ');
|
||||
}
|
||||
String pausedLabel(QuestCard card, {bool title = false}) =>
|
||||
title ? _paused(card.title, card.session, titleLast: true)
|
||||
: _paused(card.categoryName, card.session);
|
||||
|
||||
String _paused(String lead, QuestSession? session, {bool titleLast = false}) => [
|
||||
if (!titleLast) lead,
|
||||
appL10n.questPaused,
|
||||
if (titleLast) lead,
|
||||
if (session != null && session.total > 0)
|
||||
'${formatPop(session.progress)}/${formatPop(session.total)}',
|
||||
].join(' · ');
|
||||
|
||||
/// 퀘스트 줄 · 카드의 보조 줄 — 일시 정지면 「카테고리 · 일시 정지 · 43/60」, 아니면 카테고리.
|
||||
/// 진행중 탭 카드 · 「전체」 탭 맨 위 줄 · HOME TODAY'S QUEST 줄이 모두 이 표기를 쓴다
|
||||
/// (10/6 실기기 — 맨 위 줄 · HOME 줄에만 일시 정지가 빠져 있었다).
|
||||
/// [pausedSession] 은 `FirestoreQuestRepository.pausedSessionOf` 가 고른 세션이다.
|
||||
String questSubLine(String category, QuestSession? pausedSession) =>
|
||||
pausedSession == null ? category : _paused(category, pausedSession);
|
||||
|
||||
String questCardSubLine(QuestCard card) => card.stage == QuestStage.paused
|
||||
? pausedLabel(card)
|
||||
: card.categoryName;
|
||||
|
||||
/// 목록의 퀘스트 카드 한 장 — 시안 `264:46867` 카드(#1a1a1c r12 · 안쪽 20).
|
||||
///
|
||||
@@ -148,9 +160,7 @@ class QuestCardTile extends StatelessWidget {
|
||||
const SizedBox(height: 6),
|
||||
Text(
|
||||
// 진행 상태 값 「일시 정지」 · 멈춘 진행값(원장 C-83 — 기존 카드 영역 안).
|
||||
card.stage == QuestStage.paused
|
||||
? pausedLabel(card)
|
||||
: card.categoryName,
|
||||
questCardSubLine(card),
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400,
|
||||
@@ -385,7 +395,7 @@ class QuestAdminRow extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
card.categoryName,
|
||||
questCardSubLine(card),
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
|
||||
Reference in New Issue
Block a user