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

Add support for custom barriers on ModalSheet #124

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

bqubique
Copy link

Add support to add custom barrier widget instead of the standard one.

@fujidaiti
Copy link
Owner

Could you please explain what this feature is for?

@bqubique
Copy link
Author

Hey, I will have a look at it during the weekend @fujidaiti. Basically it adds support to have any kind of widget instead of AnimatedBarrier only. For example I added an ImageFilter which blurred the background of the modals.
I will need to handle other modals as well, as this only works for the GoRoute Shells. Will continue working on it hopefully soon!

@@ -155,6 +167,8 @@ mixin ModalSheetRouteMixin<T> on ModalRoute<T> {

Widget buildContent(BuildContext context);

Widget? get barrierWidget;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be a builder rather than a widget because the barrier is lazily built in buildModalBarrier. The signature could be something like ModalSheetBarrierBuilder? get barrierBuilder where ModalSheetBarrierBuilder is:

typedef ModalSheetBarrierBuilder = Widget Function(PageRoute route, VoidCallback onDismissCallback);

The route parameter is necessary to get barrierColor, barrierDismissible, etc...

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.

2 participants