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

Flicker when using two Crabs in one Beach #14

Open
xBugzilla opened this issue Nov 28, 2021 · 0 comments
Open

Flicker when using two Crabs in one Beach #14

xBugzilla opened this issue Nov 28, 2021 · 0 comments

Comments

@xBugzilla
Copy link

xBugzilla commented Nov 28, 2021

Hello. First, thank you so much for this amazing package.

Second, I want to animate two Crabs in the same Beach and they do animate but there is a flicker in between animations that does not happen with a single Crab.

file.mp4

I'm animation the text in all the transitions. And only between two pages, I animate the "operators and arrows" box too.
There is visual flicker on the transition with the "operators and arrows".

Also, how can I use flightShuttleBuilder to make the "operators and arrows" stick to the page if there is no room for it in the next or previous page? I'm using the flightShuttleBuilder from another issue related to Text that I modified so text changes instantly.

Widget textFlightShuttleBuilder(
  BuildContext flightContext,
  Animation<double> animation,
  BeachTransitionDirection direction,
  BuildContext fromCrabContext,
  BuildContext? toCrabContext,
) {
  final curvedAnimation = CurvedAnimation(parent: animation, curve: Curves.linear);
  return Stack(
    clipBehavior: Clip.none,
    children: [
      Positioned(
        top: 0,
        left: 0,
        child: FadeTransition(
          opacity: Tween<double>(begin: 0, end: 0).animate(curvedAnimation), // begin == end
          child: (fromCrabContext.widget as Crab).child,
        ),
      ),
      if (toCrabContext != null)
        Positioned(
          top: 0,
          left: 0,
          child: FadeTransition(
            opacity: Tween<double>(begin: 1, end: 1).animate(curvedAnimation),  // begin == end
            child: (toCrabContext.widget as Crab).child,
          ),
        ),
    ],
  );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant