refactor: update back navigation to prioritize popping the route stack before defaulting to home

This commit is contained in:
pradeepkumar
2026-03-31 20:41:01 +05:30
parent 8a982bdf3d
commit c2c1b51777
3 changed files with 16 additions and 2 deletions

View File

@@ -154,7 +154,13 @@ class AgentNetworkScreen extends ConsumerWidget {
child: Row(
children: [
GestureDetector(
onTap: () => context.go('/home'),
onTap: () {
if (Navigator.of(context).canPop()) {
Navigator.of(context).pop();
} else {
context.go('/home');
}
},
child: const Icon(
Icons.arrow_back_ios_new_rounded,
size: 18,