feat: Enhance socket reconnection and chat screen lifecycle management, and refine agent detail and home screen UI.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user