browser back navigation
This commit is contained in:
parent
e092b48cce
commit
2cc18f5da1
@ -93,7 +93,7 @@ class _BranchSelectionPageState extends State<BranchSelectionPage> {
|
|||||||
child: Text("Cancel"),
|
child: Text("Cancel"),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => apiService.logout(),
|
onPressed: () => Navigator.of(context).pop(true),
|
||||||
child: Text("Logout"),
|
child: Text("Logout"),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -237,7 +237,7 @@ class _CdPoliciesListState extends State<CdPoliciesList> {
|
|||||||
child: Text("Cancel"),
|
child: Text("Cancel"),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => apiService.logout(),
|
onPressed: () => Navigator.of(context).pop(true),
|
||||||
child: Text("Logout"),
|
child: Text("Logout"),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -488,7 +488,7 @@ class _cdTransactionDetailsState extends State<cdTransactionDetails> {
|
|||||||
child: Text("Cancel"),
|
child: Text("Cancel"),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => apiService.logout(),
|
onPressed: () => Navigator.of(context).pop(true),
|
||||||
child: Text("Logout"),
|
child: Text("Logout"),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -449,7 +449,7 @@ class _ClaimsPolicieState extends State<ClaimsPolicies> {
|
|||||||
child: Text("Cancel"),
|
child: Text("Cancel"),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => apiService.logout(),
|
onPressed: () => Navigator.of(context).pop(true),
|
||||||
child: Text("Logout"),
|
child: Text("Logout"),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -250,7 +250,7 @@ class _policiesState extends State<policies>
|
|||||||
child: Text("Cancel"),
|
child: Text("Cancel"),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => apiService.logout(),
|
onPressed: () => Navigator.of(context).pop(true),
|
||||||
child: Text("Logout"),
|
child: Text("Logout"),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -331,16 +331,14 @@ class _policiesState extends State<policies>
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return BaseLayout(
|
return BaseLayout(
|
||||||
child: PopScope(
|
child: WillPopScope(
|
||||||
canPop: false,
|
onWillPop: () async {
|
||||||
onPopInvoked: (didPop) async {
|
|
||||||
if (didPop) return;
|
|
||||||
|
|
||||||
final shouldLogout = await _showLogoutDialog();
|
final shouldLogout = await _showLogoutDialog();
|
||||||
|
|
||||||
if (shouldLogout) {
|
if (shouldLogout) {
|
||||||
await apiService.logout();
|
await apiService.logout();
|
||||||
if (!mounted) return;
|
if (!mounted) return false;
|
||||||
|
|
||||||
Navigator.pushNamedAndRemoveUntil(
|
Navigator.pushNamedAndRemoveUntil(
|
||||||
context,
|
context,
|
||||||
@ -348,6 +346,7 @@ class _policiesState extends State<policies>
|
|||||||
(route) => false,
|
(route) => false,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
},
|
},
|
||||||
child: buildPoliciesBody(
|
child: buildPoliciesBody(
|
||||||
openEnrollment: openForEnrollmentList,
|
openEnrollment: openForEnrollmentList,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user