Skip to content

Commit

Permalink
Fix : Not able to close pop up in Join Organization Screen Palisadoes…
Browse files Browse the repository at this point in the history
…Foundation#815

Bug was caused due to Page context was used in close button instated new context of builder.

Fix:
Refactor : ctx -> dialogContext
Change : context -> dialogContext (line 142)
  • Loading branch information
AdityaBirangal committed May 20, 2021
1 parent 3c39815 commit a81096f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ class _OrganisationTileState extends State<OrganisationTile> {
) {
showDialog(
context: widget.scaffoldKey.currentContext,
builder: (BuildContext ctx) {
builder: (BuildContext dialogContext) {
return AlertDialog(
title: const Text("Confirmation"),
content:
const Text("Are you sure you want to join this organization?"),
actions: [
TextButton(
onPressed: () {
Navigator.of(context).pop();
Navigator.of(dialogContext).pop();
},
child: const Text("Close"),
),
Expand All @@ -148,7 +148,7 @@ class _OrganisationTileState extends State<OrganisationTile> {
setState(() {
_isLoaderActive = true;
});
Navigator.of(ctx).pop();
Navigator.of(dialogContext).pop();
if (isPublic == 'true') {
await Provider.of<OrgController>(
context,
Expand All @@ -165,7 +165,7 @@ class _OrganisationTileState extends State<OrganisationTile> {
_isLoaderActive = false;
});
} else if (isPublic == 'false') {
await Provider.of<OrgController>(ctx, listen: false)
await Provider.of<OrgController>(dialogContext, listen: false)
.joinPrivateOrg(
context,
widget.fToast,
Expand Down

0 comments on commit a81096f

Please sign in to comment.