feat: implement FeaturedAgentItem model and update UI to sync with web CMS, and add form reset functionality to agent edit screen

This commit is contained in:
pradeepkumar
2026-03-30 15:12:09 +05:30
parent b3905865d6
commit 857983821d
3 changed files with 75 additions and 9 deletions

View File

@@ -504,7 +504,23 @@ class _AgentEditProfileScreenState
children: [
Expanded(
child: OutlinedButton(
onPressed: _saving ? null : () => context.pop(),
onPressed: _saving ? null : () {
// Reset form to original values (reload from provider)
setState(() {
_formData.clear();
_repeatableEntries.clear();
_initialized = false;
for (final c in _controllers) {
c.dispose();
}
_controllers.clear();
for (final c in _tagControllers.values) {
c.dispose();
}
_tagControllers.clear();
});
// Re-initialize will happen on next build via _initializeFormData
},
style: OutlinedButton.styleFrom(
side: const BorderSide(color: AppColors.primaryDark),
shape: RoundedRectangleBorder(