이벤트 개발완료
This commit is contained in:
@@ -38,32 +38,60 @@ class BadgeStyles {
|
||||
return _chip(type, bg, icon);
|
||||
}
|
||||
|
||||
// 게스트용 초소형 원형 배지 (이니셜 'G')
|
||||
static Widget guestSmall({double size = 18, Color? bg, Color? fg}) {
|
||||
final Color bgColor = bg ?? neutralBg;
|
||||
final Color fgColor = fg ?? Colors.black87;
|
||||
return Container(
|
||||
width: size,
|
||||
height: size,
|
||||
decoration: BoxDecoration(
|
||||
color: bgColor,
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(color: Colors.grey.shade300),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'G',
|
||||
style: TextStyle(
|
||||
fontSize: size * 0.62,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: fgColor,
|
||||
height: 1.0,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 참가 상태 컬러/아이콘 매핑
|
||||
static Chip participantStatus(String status) {
|
||||
late final Color bg;
|
||||
late final IconData icon;
|
||||
switch (status) {
|
||||
case '등록됨':
|
||||
bg = neutralBg;
|
||||
icon = Icons.how_to_reg;
|
||||
break;
|
||||
case '확인됨':
|
||||
bg = successBg;
|
||||
icon = Icons.check_circle;
|
||||
break;
|
||||
case '취소됨':
|
||||
bg = dangerBg;
|
||||
icon = Icons.cancel;
|
||||
break;
|
||||
case '참석함':
|
||||
bg = primaryBg;
|
||||
icon = Icons.event_available;
|
||||
break;
|
||||
default:
|
||||
bg = neutralBg;
|
||||
icon = Icons.help_outline;
|
||||
// status는 한국어 라벨 또는 API 값(pending/confirmed/canceled/attended)로 들어올 수 있음
|
||||
final s = status.toLowerCase();
|
||||
String label;
|
||||
if (s == 'pending' || s == '참가예정' || s == '등록됨' || s == '대기') {
|
||||
bg = neutralBg;
|
||||
icon = Icons.how_to_reg;
|
||||
label = '예정';
|
||||
} else if (s == 'confirmed' || s == '참가확정' || s == '확인됨') {
|
||||
bg = successBg;
|
||||
icon = Icons.check_circle;
|
||||
label = '확정';
|
||||
} else if (s == 'canceled' || s == '취소' || s == '취소됨') {
|
||||
bg = dangerBg;
|
||||
icon = Icons.cancel;
|
||||
label = '취소';
|
||||
} else if (s == 'attended' || s == '참석' || s == '참석함') {
|
||||
bg = primaryBg;
|
||||
icon = Icons.event_available;
|
||||
label = '참석';
|
||||
} else {
|
||||
bg = neutralBg;
|
||||
icon = Icons.help_outline;
|
||||
label = status;
|
||||
}
|
||||
return _chip(status, bg, icon);
|
||||
return _chip(label, bg, icon);
|
||||
}
|
||||
|
||||
// 회원 상태 컬러/아이콘 매핑 (라벨 기준: 활성/비활성/정지/삭제됨)
|
||||
@@ -97,7 +125,7 @@ class BadgeStyles {
|
||||
// 결제 상태 컬러/아이콘 매핑
|
||||
static Chip payment(bool isPaid) {
|
||||
return _chip(
|
||||
isPaid ? '결제완료' : '미결제',
|
||||
isPaid ? '납부' : '미납',
|
||||
isPaid ? successBg : dangerBg,
|
||||
isPaid ? Icons.check_circle : Icons.cancel,
|
||||
);
|
||||
@@ -107,28 +135,32 @@ class BadgeStyles {
|
||||
static Chip eventStatus(String status) {
|
||||
late final Color bg;
|
||||
late final IconData icon;
|
||||
switch (status) {
|
||||
case '활성':
|
||||
bg = successBg;
|
||||
icon = Icons.check_circle;
|
||||
break;
|
||||
case '대기':
|
||||
bg = Colors.amber.shade100;
|
||||
icon = Icons.hourglass_top;
|
||||
break;
|
||||
case '취소':
|
||||
bg = dangerBg;
|
||||
icon = Icons.cancel;
|
||||
break;
|
||||
case '완료':
|
||||
bg = Colors.grey.shade300;
|
||||
icon = Icons.done_all;
|
||||
break;
|
||||
default:
|
||||
bg = neutralBg;
|
||||
icon = Icons.event;
|
||||
// DB 원시값(영문) 또는 한국어 라벨을 모두 지원하도록 정규화
|
||||
final s = status.toLowerCase().trim();
|
||||
String label = status; // 표시용 라벨 (한국어)
|
||||
if (s == 'active' || s == 'enabled' || s == '활성') {
|
||||
label = '활성';
|
||||
bg = successBg;
|
||||
icon = Icons.check_circle;
|
||||
} else if (s == 'pending' || s == 'draft' || s == 'scheduled' || s == 'waiting' || s == '대기') {
|
||||
label = '대기';
|
||||
bg = Colors.amber.shade100;
|
||||
icon = Icons.hourglass_top;
|
||||
} else if (s == 'canceled' || s == 'cancelled' || s == '취소') {
|
||||
label = '취소';
|
||||
bg = dangerBg;
|
||||
icon = Icons.cancel;
|
||||
} else if (s == 'completed' || s == 'done' || s == 'finished' || s == '완료') {
|
||||
label = '완료';
|
||||
bg = Colors.grey.shade300;
|
||||
icon = Icons.done_all;
|
||||
} else {
|
||||
// 알 수 없는 상태는 중립 처리
|
||||
label = status;
|
||||
bg = neutralBg;
|
||||
icon = Icons.event;
|
||||
}
|
||||
return _chip(status, bg, icon);
|
||||
return _chip(label, bg, icon);
|
||||
}
|
||||
|
||||
static Chip _chip(String text, Color bg, IconData icon) {
|
||||
|
||||
Reference in New Issue
Block a user