Open ghost opened 4 years ago
Hello :)
Did you check the example project ? https://github.com/jaumard/flare_splash_screen/blob/master/example/lib/main.dart#L15
What do you mean by it's not working
exactly ?
Yes checked it. This is not working: by default it does a fade animation but you can customize it by using transitionsBuilder
It doesnt work
I've tried using transitionBuilder but it didn't work either.
I'm having the same issue as well. There is no animation (fade or my implementation of slide) that occurs when the "loading" (in this case an simulation of 10 seconds.
Here's my implementation:
SplashScreen.navigate(
name: 'lib/graphics/splash-screen.flr',
next: (context) => LibraryNavigator(),
transitionsBuilder: (_, animation, __, child) {
return SlideTransition(
position: Tween<Offset>(
begin: const Offset(0, -1),
end: Offset.zero,
).animate(animation),
child: child,
);
},
until: () => Future.delayed(Duration(seconds: 10)),
backgroundColor: const Color(0xFF32407b),
alignment: Alignment.center,
height: 300,
width: 300,
loopAnimation: 'loading',
endAnimation: 'done',
),
I just get a dark screen and the app is stuck
Check pubspec.yaml, path to your flr file or names for animations. I had problem with those.
Hi! I have read in the documentation that the SplashScreen.navigate method has a default fade transition but for me it's not working. I have tried replacing it by transitionsBuilder but this transition it's not working either. Here is my code:
`class SplashAnimationScreen extends StatefulWidget { @override _SplashAnimationScreenState createState() => _SplashAnimationScreenState(); }
class _SplashAnimationScreenState extends State {
bool _isLoading = true;
Widget _initialPage = HomeScreen();
@override void initState() { _setInitialRoute(); super.initState(); }
@override Widget build(BuildContext context) { return SplashScreen.navigate( name: 'assets/animations/splashanimation.flr', next: () => _initialPage, isLoading: _isLoading, startAnimation: 'StartAnimation', backgroundColor: Styles.primaryColorDark, transitionsBuilder: (context, animation, secondaryAnimation, child) { var begin = Offset(0.0, 1.0); var end = Offset.zero; var curve = Curves.ease;
}
_setInitialRoute() async { SharedPreferences prefs = await SharedPreferences.getInstance(); String initialRoute = (prefs.getString('initialRoute') ?? onboardingRoute);
} }`
¿I am doing something wrong?
Thank you in advance!