yumi-flutter/lib/shared/tools/sc_cp_relation_notice_utils.dart
2026-05-21 18:55:14 +08:00

68 lines
1.6 KiB
Dart

String scNormalizeCpRelationType(String? relationType) {
final value = relationType?.trim().toUpperCase() ?? "";
switch (value) {
case "BROTHER":
case "BROTHERS":
case "SWORN_BROTHER":
case "SWORN_BROTHERS":
return "BROTHER";
case "SISTER":
case "SISTERS":
return "SISTERS";
default:
return "CP";
}
}
String scCpRelationBecomeLabel(String? relationType) {
switch (scNormalizeCpRelationType(relationType)) {
case "BROTHER":
return "sworn brothers";
case "SISTERS":
return "sisters";
default:
return "a CP";
}
}
String scCpRelationPossessiveLabel(String? relationType) {
switch (scNormalizeCpRelationType(relationType)) {
case "BROTHER":
return "brother";
case "SISTERS":
return "sister";
default:
return "CP";
}
}
String scCpRelationDialogTitle(String? relationType) {
switch (scNormalizeCpRelationType(relationType)) {
case "BROTHER":
return "Become sworn brothers";
case "SISTERS":
return "Become sisters";
default:
return "Become a couple";
}
}
String scBuildCpRelationEstablishedNotice({
required String userName1,
required String userName2,
required String? relationType,
}) {
return "[System Notification] $userName1 and $userName2 have become "
"${scCpRelationBecomeLabel(relationType)}.";
}
String scBuildCpRelationJoinNotice({
required String ownerName,
required String joinedName,
required String? relationType,
}) {
return "[System Notification] $ownerName's "
"${scCpRelationPossessiveLabel(relationType)}, $joinedName, "
"has joined the party.";
}