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
How do we use the transitionsBuilder property? #3
Comments
As a follow up to this, the syntax is incorrect because there is no child property for the animation. A child property also cannot be added because it returns an error. The issue seems to be in flare_splash_screen.dart of the library. In line 19 we have the following code final RoutePageBuilder transitionsBuilder; In the flutter API documentation for transitionsBuilder here, the implementation of transitionsBuilder is final RouteTransitionsBuilder transitionsBuilder Therefore I believe the type definition in the library is incorrect and so it needs to be changed. The incorrect type definition also repeats in line 35 as RoutePageBuilder transitionsBuilder, and in line 68 as RoutePageBuilder transitionsBuilder, All 3 cases need to be changed so that the type definition is RouteTransitionsBuilder |
After changing the type in the above pull request the following code now works to implement a slide transition home: SplashScreen.navigate(
name: 'assets/splash.flr',
next: HomePage(),
until: () => Future.delayed(Duration(seconds: 2)),
startAnimation: 'SplashScreen',
backgroundColor: Color(0xff211E25),
transitionsBuilder: (c, a, a1, child) {
return SlideTransition(
position: Tween<Offset>(
begin: const Offset(-1, 0),
end: Offset.zero,
).animate(a),
child: child,
);
},
), |
Published in 2.1.2! |
Shown below is a snippet of my code, it does not execute the appropriate transition but instead gets stuck on the splash screen.
Instead of desired output i get the following error message
Could someone please explain how transitionsBuilder is supposed to be used here
The text was updated successfully, but these errors were encountered: