Skip to content

[go_router] CustomTransitionPage.barrierDismissible is not working #102289

@jnschulze

Description

@jnschulze

GoRouter's CustomTransitionPage.barrierDismissible is not working as the _CustomTransitionPageRoute returned by CustomTransitionPage.createRoute doesn't override PageRoute.barrierDismissible (which always returns false).

Steps to reproduce:

Use a CustomTransitionPage with barrierDismissible set to true.
E.g.

  GoRoute(
      path: '/foo',
      pageBuilder: (context, state) {
        return CustomTransitionPage(
            transitionsBuilder: (context, _, __, child) => child,
            barrierDismissible: true,
            barrierColor: Colors.black.withOpacity(0.7),
            opaque: false,
            fullscreenDialog: false,
            transitionDuration: Duration.zero,
            child: Align(
                child:
                    Container(width: 200, height: 200, color: Colors.green)));
      });

Expected result

The modal can be closed by clicking at the barrier.

Actual result

The modal stays open.

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listfound in release: 2.10Found to occur in 2.10found in release: 2.13Found to occur in 2.13has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: go_routerThe go_router packagepackageflutter/packages repository. See also p: labels.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions