feat: implement dynamic field labels for agent profile sections using backend-provided slugs
This commit is contained in:
@@ -292,6 +292,26 @@ class AgentDetailState {
|
||||
return '${'*' * (digits.length - 4)}${digits.substring(digits.length - 4)}';
|
||||
}
|
||||
|
||||
// ── Dynamic labels (fieldName from backend, with fallback) ──
|
||||
|
||||
String _labelForSlug(String slug, String fallback) {
|
||||
for (final fv in fieldValues) {
|
||||
if (fv.fieldSlug == slug && fv.fieldName.isNotEmpty) {
|
||||
return fv.fieldName;
|
||||
}
|
||||
}
|
||||
return fallback;
|
||||
}
|
||||
|
||||
String get availabilityLabel =>
|
||||
_labelForSlug('availability', 'Availability');
|
||||
|
||||
String get workEnvironmentLabel =>
|
||||
_labelForSlug('preferred_work_environment', 'Preferred Work Environment');
|
||||
|
||||
String get bestExperienceLabel =>
|
||||
_labelForSlug('best_experience', 'Best Experience');
|
||||
|
||||
// ── Availability ──
|
||||
|
||||
String get availabilityType {
|
||||
|
||||
Reference in New Issue
Block a user