browser back navigation

This commit is contained in:
Surendiran 2026-02-18 10:39:13 +05:30
parent e092b48cce
commit 2cc18f5da1
5 changed files with 9 additions and 10 deletions

View File

@ -93,7 +93,7 @@ class _BranchSelectionPageState extends State<BranchSelectionPage> {
child: Text("Cancel"),
),
TextButton(
onPressed: () => apiService.logout(),
onPressed: () => Navigator.of(context).pop(true),
child: Text("Logout"),
),
],

View File

@ -237,7 +237,7 @@ class _CdPoliciesListState extends State<CdPoliciesList> {
child: Text("Cancel"),
),
TextButton(
onPressed: () => apiService.logout(),
onPressed: () => Navigator.of(context).pop(true),
child: Text("Logout"),
),
],

View File

@ -488,7 +488,7 @@ class _cdTransactionDetailsState extends State<cdTransactionDetails> {
child: Text("Cancel"),
),
TextButton(
onPressed: () => apiService.logout(),
onPressed: () => Navigator.of(context).pop(true),
child: Text("Logout"),
),
],

View File

@ -449,7 +449,7 @@ class _ClaimsPolicieState extends State<ClaimsPolicies> {
child: Text("Cancel"),
),
TextButton(
onPressed: () => apiService.logout(),
onPressed: () => Navigator.of(context).pop(true),
child: Text("Logout"),
),
],

View File

@ -250,7 +250,7 @@ class _policiesState extends State<policies>
child: Text("Cancel"),
),
TextButton(
onPressed: () => apiService.logout(),
onPressed: () => Navigator.of(context).pop(true),
child: Text("Logout"),
),
],
@ -331,16 +331,14 @@ class _policiesState extends State<policies>
@override
Widget build(BuildContext context) {
return BaseLayout(
child: PopScope(
canPop: false,
onPopInvoked: (didPop) async {
if (didPop) return;
child: WillPopScope(
onWillPop: () async {
final shouldLogout = await _showLogoutDialog();
if (shouldLogout) {
await apiService.logout();
if (!mounted) return;
if (!mounted) return false;
Navigator.pushNamedAndRemoveUntil(
context,
@ -348,6 +346,7 @@ class _policiesState extends State<policies>
(route) => false,
);
}
return false;
},
child: buildPoliciesBody(
openEnrollment: openForEnrollmentList,