Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the ModalBarrier not dismissible when barrierEnabled is true #9

Merged
merged 1 commit into from
May 28, 2022

Conversation

franciscrispin
Copy link
Contributor

Related issue: #5

The ModalBarrier that is shown when barrierEnabled is true has a dismissible value that defaults to true. This means the ModalBarrier can still be dismissed even though the barrier is enabled.

Approach 1: This PR sets the dismissible value to false so the ModalBarrier cannot be dismissed.

Approach 2:

If it is the intention of the author to leave dismissible as true, another way to solve the issue is to make the following change:

// https://github.com/FlorinMihalache/flutter_progress_hud/blob/master/lib/flutter_progress_hud.dart#L128
IgnorePointer(
   ignoring: widget.barrierEnabled || !_isShow,
   ...

Approach 1 seems preferable because it is slightly counter-intuitive if the ModalBarrier can be dismissed even though barrierEnabled is true.

@franciscrispin
Copy link
Contributor Author

Hi @FlorinMihalache, could you help review this PR, thanks!

@glintpursuit
Copy link

Please merge this PR

@FlorinMihalache
Copy link
Owner

I know it's been some time, but I merged your PR. Thank you @franciscrispin :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants