feat: Add professional ratings to cards, implement scroll-to-top on home tab re-tap, and improve agent type fetching in the hero section.
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:real_estate_mobile/core/constants/app_colors.dart';
|
||||
import 'package:real_estate_mobile/features/auth/presentation/providers/auth_provider.dart';
|
||||
import 'package:real_estate_mobile/features/home/presentation/screens/home_screen.dart';
|
||||
|
||||
/// Determines which tab is active based on the current route.
|
||||
int _currentTabIndex(BuildContext context) {
|
||||
@@ -42,7 +43,24 @@ class AppBottomNavBar extends ConsumerWidget {
|
||||
svgPath: 'assets/icons/nav_home_icon.svg',
|
||||
fallbackIcon: Icons.home,
|
||||
isSelected: selectedIndex == 0,
|
||||
onTap: () => context.go('/home'),
|
||||
onTap: () {
|
||||
if (selectedIndex == 0) {
|
||||
// Already on home — scroll to top
|
||||
try {
|
||||
final controller =
|
||||
ref.read(homeScrollControllerProvider);
|
||||
if (controller.hasClients) {
|
||||
controller.animateTo(
|
||||
0,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
curve: Curves.easeOut,
|
||||
);
|
||||
}
|
||||
} catch (_) {}
|
||||
} else {
|
||||
context.go('/home');
|
||||
}
|
||||
},
|
||||
),
|
||||
_NavItem(
|
||||
svgPath: 'assets/icons/nav_list_icon.svg',
|
||||
|
||||
Reference in New Issue
Block a user