You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, ModalRoutes created using showDialog or showGeneralDialog do not allow full customization of the underlying ModalBarrier.
It’s only possible to change the background color, however I’d like full control over the animated widget in order to build my own. For example, a customer requested to apply Gaussian blur to the barrier.
The current solution involves creating the barrier myself and not using the neat routing system.
So the same way that showGeneralRoute has a PageBuilder Parameter, it could gain a BarrierBuilder.
ince this issue is still open, I’d like to share a clean way to fully customize the ModalBarrier (e.g., adding a Gaussian blur) without requiring changes to Flutter’s core.
The approach is to extend RawDialogRoute and override buildModalBarrier, allowing the barrier to be wrapped with any widget (such as BackdropFilter) and enabling a custom dismissal callback.
This provides full control over the barrier’s appearance and behavior while remaining compatible with the existing Navigator API.
Activity
saibotma commentedon Jun 16, 2023
It would be great if the dismiss action could be customized as well. Currently, it just pops on dismiss, which is not always appropriate.
Mairramer commentedon Feb 16, 2026
ince this issue is still open, I’d like to share a clean way to fully customize the ModalBarrier (e.g., adding a Gaussian blur) without requiring changes to Flutter’s core.
The approach is to extend
RawDialogRouteand override buildModalBarrier, allowing the barrier to be wrapped with any widget (such as BackdropFilter) and enabling a custom dismissal callback.This provides full control over the barrier’s appearance and behavior while remaining compatible with the existing Navigator API.
View example on DartPad
Add barrierBuilder support to showDialog and showGeneralDialog (flutt…