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 NoAnimationPageTransitionsBuilder #99514

Closed
johnpryan opened this issue Mar 3, 2022 · 3 comments
Closed

Add NoAnimationPageTransitionsBuilder #99514

johnpryan opened this issue Mar 3, 2022 · 3 comments
Labels
r: duplicate Issue is closed as a duplicate of an existing issue

Comments

@johnpryan
Copy link
Contributor

johnpryan commented Mar 3, 2022

I recently learned that Material Design apps shouldn't display transition animations on desktop platforms. If this is the case, the default builders in the PageTransitionsTheme class don't seem to be using the correct PageTransitionsBuilder:

  static const Map<TargetPlatform, PageTransitionsBuilder> _defaultBuilders = <TargetPlatform, PageTransitionsBuilder>{
    TargetPlatform.android: FadeUpwardsPageTransitionsBuilder(),
    TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
    TargetPlatform.linux: FadeUpwardsPageTransitionsBuilder(),
    TargetPlatform.macOS: CupertinoPageTransitionsBuilder(),
    TargetPlatform.windows: FadeUpwardsPageTransitionsBuilder(),
  };

Proposal

Create a new class, NoAnimationPageTransitionsBuilder and use that as the default PageTransitionsBuilder for linux, macOS, and Windows:

class NoAnimationPageTransitionsBuilder extends PageTransitionsBuilder {
  const NoAnimationPageTransitionsBuilder();

  @override
  Widget buildTransitions<T>(
      PageRoute<T> route,
      BuildContext context,
      Animation<double> animation,
      Animation<double> secondaryAnimation,
      Widget child,
      ) {
    return child;
  }
}
@johnpryan
Copy link
Contributor Author

johnpryan commented Mar 3, 2022

After more investigation, it looks like this behavior was reverted due to the animation delay: #89997

cc: @darrenaustin WDYT?

@maheshmnj maheshmnj added the in triage Presently being triaged by the triage team label Mar 4, 2022
@maheshmnj
Copy link
Member

Hi @johnpryan, Thanks for filing the issue. This issue is already filed and is being tracked here #99052

Please followup there for further updates, Closing this issue as a duplicate of the linked issue.

@maheshmnj maheshmnj added r: duplicate Issue is closed as a duplicate of an existing issue and removed in triage Presently being triaged by the triage team labels Mar 4, 2022
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
r: duplicate Issue is closed as a duplicate of an existing issue
Projects
None yet
Development

No branches or pull requests

2 participants