RouteBarrierBuilder typedef

RouteBarrierBuilder = Widget Function(BuildContext context, RouteBarrierDetails details, Widget barrier)

Signature for the function that builds a custom modal barrier for a route.

Used by RawDialogRoute.barrierBuilder and showGeneralDialog to wrap or replace the default modal barrier.

The barrier parameter is the default ModalBarrier (or AnimatedModalBarrier) constructed by the framework. Custom builders should typically return a widget that wraps this barrier (for instance, with a Padding or a BackdropFilter), rather than replacing it entirely, to preserve the built-in semantics and gestures.

Implementation

typedef RouteBarrierBuilder =
    Widget Function(BuildContext context, RouteBarrierDetails details, Widget barrier);