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

39 lines
824 B
Dart

extension XStringUtils on String {
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;
}
}
String get faItem => utilsMap[this] ?? this;
bool get buyerIsGuild {
final tmp = split('_');
if (tmp.length > 1) {
return tmp.last == 'guild';
} else {
return false;
}
}
String get faTitle {
return utilsMap[this] ?? this;
}
}
Map<String, String> utilsMap = {
'killhouse': 'کشتارگاه',
'_': 'به',
'steward': 'مباشر',
'exclusive': 'اختصاصی',
'free': 'آزاد',
'pending': 'در انتظار',
'accepted': 'تایید شده',
'guild': 'صنف',
'governmental': 'دولتی',
};