Skip to content

Expose MaterialPageRoute ZoomEnterTransition scrim color #152064

@Michal-MK

Description

@Michal-MK

Use case

The motivation is here, I came across it today as well.

The solution here says to create custom transitions, this is an overkill to me.
#115995

The solution here suggests removing the transition altogether which is is not a real solution, but was accepted for some reason. With the conclusion: "The conclusion seems to be: do not use the default transition or you will have issues." That is something I do not want to be a conclusion about Flutter :D
https://stackoverflow.com/questions/74978431/black-border-around-scaffold-body-during-page-transition

Proposal

Currently the _drawScrim in _ZoomEnterTransitionPainter hard-codes

Paint()..color = Colors.black.withOpacity(scrimOpacity),

Instead, a Color? scrimColor could be passed in and default to Colors.black if none was set.

I have examples (slowed down 8x)

Current example: (produces weird black bars on the edges, looks worse at full animation speed)

2024-07-20.12-03-12.mp4

With simple change of:

Paint()..color = Colors.white.withOpacity(scrimOpacity),

I can get rid of them.

2024-07-20.12-04-23.mp4

So the proposal is to make the color a parameter that can be passed in.
I am willing to do it if this proposal is accepted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: proposalA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.f: routesNavigator, Router, and related APIs.frameworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions