feat: Implement optimistic UI for agent availability toggle, add email and phone visibility toggles, and improve the logout process with immediate socket disconnection and best-effort API calls.

This commit is contained in:
pradeepkumar
2026-03-15 00:35:39 +05:30
parent 54fdd66270
commit 21f669fca5
6 changed files with 104 additions and 14 deletions

View File

@@ -196,6 +196,38 @@ class AgentProfile {
return tags;
}
AgentProfile copyWith({bool? isAvailable}) {
return AgentProfile(
id: id,
userId: userId,
firstName: firstName,
lastName: lastName,
headline: headline,
bio: bio,
avatar: avatar,
companyName: companyName,
phone: phone,
website: website,
city: city,
state: state,
country: country,
averageRating: averageRating,
totalReviews: totalReviews,
isVerified: isVerified,
isFeatured: isFeatured,
isActive: isActive,
isAvailable: isAvailable ?? this.isAvailable,
email: email,
agentType: agentType,
user: user,
fieldValues: fieldValues,
createdAt: createdAt,
legacySpecializations: legacySpecializations,
languages: languages,
serviceAreas: serviceAreas,
);
}
factory AgentProfile.fromJson(Map<String, dynamic> json) {
return AgentProfile(
id: json['id'] as String,