feat: Enhance socket reconnection and chat screen lifecycle management, and refine agent detail and home screen UI.

This commit is contained in:
pradeepkumar
2026-03-19 03:58:03 +05:30
parent 6936c29c13
commit 21e677bf27
5 changed files with 75 additions and 22 deletions

View File

@@ -44,9 +44,6 @@ class HomeScreen extends ConsumerWidget {
// Testimonials Section
const TestimonialsSection(),
const SizedBox(height: 40),
// Footer
_buildFooter(context),
],
),
);
@@ -59,7 +56,7 @@ class HomeScreen extends ConsumerWidget {
'FAQ': '/faq',
};
Widget _buildFooter(BuildContext context) {
Widget _buildFooter(BuildContext context, WidgetRef ref) {
return Container(
width: double.infinity,
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 24),
@@ -76,13 +73,13 @@ class HomeScreen extends ConsumerWidget {
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
_buildFooterLink(context, 'Home'),
_buildFooterLink(context, 'Home', ref),
_buildFooterDot(),
_buildFooterLink(context, 'About'),
_buildFooterLink(context, 'About', ref),
_buildFooterDot(),
_buildFooterLink(context, 'Contact'),
_buildFooterLink(context, 'Contact', ref),
_buildFooterDot(),
_buildFooterLink(context, 'FAQ'),
_buildFooterLink(context, 'FAQ', ref),
],
),
const SizedBox(height: 16),
@@ -100,11 +97,22 @@ class HomeScreen extends ConsumerWidget {
);
}
Widget _buildFooterLink(BuildContext context, String text) {
Widget _buildFooterLink(BuildContext context, String text, WidgetRef ref) {
return GestureDetector(
onTap: () {
final route = _footerRoutes[text];
if (route != null) context.go(route);
if (route == null) return;
final currentLocation = GoRouterState.of(context).uri.toString();
if (route == '/home' && currentLocation == '/home') {
// Already on home — scroll to top
ref.read(homeScrollControllerProvider).animateTo(
0,
duration: const Duration(milliseconds: 400),
curve: Curves.easeOut,
);
} else {
context.go(route);
}
},
child: Text(
text,