diff --git a/lib/features/home/presentation/widgets/top_professionals_section.dart b/lib/features/home/presentation/widgets/top_professionals_section.dart index a22abb7..182fc59 100644 --- a/lib/features/home/presentation/widgets/top_professionals_section.dart +++ b/lib/features/home/presentation/widgets/top_professionals_section.dart @@ -428,7 +428,7 @@ class _TopProfessionalsSectionState const SizedBox(height: 8), ], - // Expertise tags + // Expertise tags (max 3 visible + "more" pill) if (expertiseTags.isNotEmpty) ...[ const Text( 'Expertise:', @@ -444,10 +444,27 @@ class _TopProfessionalsSectionState alignment: WrapAlignment.start, spacing: 6, runSpacing: 6, - children: expertiseTags - .take(6) - .map((tag) => _buildTag(tag)) - .toList(), + children: [ + ...expertiseTags.take(3).map((tag) => _buildTag(tag)), + if (expertiseTags.length > 3) + Container( + padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: AppColors.accentOrange.withValues(alpha: 0.1), + border: Border.all(color: AppColors.accentOrange, width: 0.7), + ), + child: Text( + '+${expertiseTags.length - 3} more', + style: const TextStyle( + fontFamily: 'SourceSerif4', + fontSize: 13, + fontWeight: FontWeight.w600, + color: AppColors.accentOrange, + ), + ), + ), + ], ), const SizedBox(height: 12), ], diff --git a/lib/features/profile/presentation/widgets/profile_settings_tab.dart b/lib/features/profile/presentation/widgets/profile_settings_tab.dart index 0ceaf9f..0bd0800 100644 --- a/lib/features/profile/presentation/widgets/profile_settings_tab.dart +++ b/lib/features/profile/presentation/widgets/profile_settings_tab.dart @@ -38,10 +38,23 @@ class _ProfileSettingsTabState extends ConsumerState { _emailController = TextEditingController(); _phoneController = TextEditingController(); _locationController = TextEditingController(); + // Listen for changes to enable/disable Cancel & Save buttons + _fullNameController.addListener(_onFieldChanged); + _titleController.addListener(_onFieldChanged); + _phoneController.addListener(_onFieldChanged); + _locationController.addListener(_onFieldChanged); + } + + void _onFieldChanged() { + setState(() {}); // triggers rebuild so _hasChanges is re-evaluated } @override void dispose() { + _fullNameController.removeListener(_onFieldChanged); + _titleController.removeListener(_onFieldChanged); + _phoneController.removeListener(_onFieldChanged); + _locationController.removeListener(_onFieldChanged); _fullNameController.dispose(); _titleController.dispose(); _emailController.dispose(); diff --git a/lib/features/profile/presentation/widgets/profile_shared_widgets.dart b/lib/features/profile/presentation/widgets/profile_shared_widgets.dart index fbad9e5..202787b 100644 --- a/lib/features/profile/presentation/widgets/profile_shared_widgets.dart +++ b/lib/features/profile/presentation/widgets/profile_shared_widgets.dart @@ -146,8 +146,10 @@ class ProfileActionButtons extends StatelessWidget { Expanded( flex: 3, child: GestureDetector( - onTap: isSaving ? null : onSave, - child: Container( + onTap: (isSaving || !hasChanges) ? null : onSave, + child: Opacity( + opacity: hasChanges ? 1.0 : 0.5, + child: Container( height: 31, padding: const EdgeInsets.symmetric(horizontal: 8), decoration: BoxDecoration( @@ -174,6 +176,7 @@ class ProfileActionButtons extends StatelessWidget { )), ), ), + ), ), ), ],