Files
rasadyar_application/packages/chicken/lib/presentation/utils/string_utils.dart

39 lines
805 B
Dart
Raw Normal View History

2025-07-07 11:38:37 +03:30
extension XStringUtils on String {
get faAllocationType {
final tmp = split('_');
tmp.insert(1, '_');
if (tmp.length > 1) {
return tmp.map((e) => utilsMap[e] ?? e).join(' ');
} else {
return utilsMap[this] ?? this;
}
}
get faItem => utilsMap[this] ?? this;
2025-06-27 18:08:53 +03:30
get buyerIsGuild {
final tmp = split('_');
if (tmp.length > 1) {
return tmp.last == 'guild';
} else {
return false;
}
}
2025-10-11 17:16:26 +03:30
String get faTitle {
return utilsMap[this] ?? this;
}
}
Map<String, String> utilsMap = {
'killhouse': 'کشتارگاه',
'_': 'به',
'steward': 'مباشر',
'exclusive': 'اختصاصی',
'free': 'آزاد',
'pending': 'در انتظار',
'accepted': 'تایید شده',
2025-06-27 18:08:53 +03:30
'guild': 'صنف',
2025-10-11 17:16:26 +03:30
'governmental': 'دولتی',
};