browser back navigation
This commit is contained in:
parent
e092b48cce
commit
2cc18f5da1
@ -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"),
|
||||
),
|
||||
],
|
||||
|
||||
@ -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"),
|
||||
),
|
||||
],
|
||||
|
||||
@ -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"),
|
||||
),
|
||||
],
|
||||
|
||||
@ -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"),
|
||||
),
|
||||
],
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user