-
Notifications
You must be signed in to change notification settings - Fork 8
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
The is a delay in showing the secondPage after the animation #1
Comments
Hey @JosueMCapita, thanks for the feedback but that was just an example, you can customize the delay passing a RippleEffect(
pageKey: pageKey,
effectKey: effectKey,
delay: const Duration(milliseconds: 500)
child: ...
) |
Hey! Thanks for the quick answer @ericdallo. You have there a great package by the way!! My problem is that after running the animation, the first page remains for some seconds and then the second page shows. Its a bit different from the example that you have shown in .gif. My second page must have the Thanks in advance. |
Thank you :) There are 3 properties that may achieve what you are looking for:
|
Yes I have! The first screen has an illustration of a boy in the rain (it doesn't show at the beginning of the .gif, because it took a little bit to fully load), a text and a After the animation, it goes to a second screen but with a small delay. And here is the code: RipplePage(
pageKey: pageKey,
...
RippleEffect(
pageKey: pageKey,
effectKey: effectKey,
animationDuration: const Duration(seconds: 2),
delay: const Duration(milliseconds: 450),
color: ColorGreen,
child: const CircularProgressIndicator(),
),
...
); And I start the RippleEffect using RippleEffect.start(effectKey, () {
Navigator.of(context).pushReplacement(
FadeRouteBuilder(
page: MainHome(),
),
);
}); |
Nice! |
@ericdallo yes I've tried, but I got the same result! I will try setting |
Hi @ericdallo ! Still working the same way. |
I'll take a look on it later today and try to reproduce this behavior @JosueMCapita |
Thank you very much @ericdallo. |
@JosueMCapita, I just tested with the example app from this project using the following config: animationDuration: const Duration(seconds: 2),
delay: Duration.zero,
inflateMultiplier: 1.0, I achieved what you want after adding the |
Thanks for your help, @ericdallo Can you show me all of the code that you used for this test, please ? Maybe the problem was the way I implemented! Because it still working the same way! Here is my full code: import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
.......
import 'package:ripple_effect/ripple_effect.dart';
class InitApp extends StatefulWidget {
@override
_InitAppState createState() => _InitAppState();
}
class _InitAppState extends State<InitApp> {
final pageKey = RipplePage.createGlobalKey();
final effectKey = RippleEffect.createGlobalKey();
bool _showWhiteLogo = false;
@override
void initState() {
SystemChrome.setEnabledSystemUIOverlays([]);
_initUserData();
super.initState();
}
@override
Widget build(BuildContext context) {
return RipplePage(
pageKey: pageKey,
child: Scaffold(
backgroundColor: ColorWhite2,
body: Stack(
fit: StackFit.expand,
alignment: Alignment.center,
children: [
Positioned(
top: 40,
left: 0,
right: 0,
child: AppLogo.aspectRatio(
aspectRatio: 3 / 0.3,
logoAssetPath: (_showWhiteLogo) ? "assets/images/logo-white.png" : "assets/images/logo-colored.png",
),
),
Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
AspectRatio(
aspectRatio: 3 / 2,
child: Image.asset("assets/images/express_rain.png"),
),
const SizedBox(
height: 30,
),
Text(
"Preparando o ambiente",
style: Theme.of(context).textTheme.headline3.copyWith(
fontSize: 15
),
),
const SizedBox(
height: 20,
),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 40,
),
child: Text(
"Estamos buscando todos os dados e preparando\no ambiente para si",
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.headline3.copyWith(
fontSize: 13,
color: Colors.grey[400]
),
),
),
const SizedBox(
height: 40,
),
RippleEffect(
pageKey: pageKey,
effectKey: effectKey,
animationDuration: Duration(seconds: 2),
delay: Duration.zero,
color: ColorGreen,
inflateMultiplier: 1.0,
child: CustomCircularProgressIndicatorWidget(),
),
],
),
],
),
),
);
}
void _initUserData() async {
SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);
final String jwt = await SharedPreferencesService.getUserData(context);
if (jwt != null) {
var reponse = await getUserData(jwt);
if (reponse != null) {
if (reponse.status == 200) {
if (reponse.code == "000") {
AuthenticationService.initializeAppData(context, reponse, jwt: jwt);
RippleEffect.start(effectKey, () {
Navigator.of(context).pushReplacement(
FadeRouteBuilder(
page: MainHome(),
),
);
});
return;
} else if (reponse.code == "004") {
RippleEffect.start(effectKey, () {
insertOverlay(context, message: "Sessão inválida, volte a iniciar a sessão", success: false);
Navigator.of(context).pushReplacement(
FadeRouteBuilder(
page: LoginPage(),
),
);
});
}
}
}
}
RippleEffect.start(effectKey, () {
Navigator.of(context).pushReplacement(
FadeRouteBuilder(
page: WelcomePage(),
),
);
});
}
} |
I updated the example of the repo with that code |
@JosueMCapita Can you confirm what version of the lib are you using? I released a new version today |
@ericdallo I am using version |
Odd...
And record a gif if does not work |
OK @ericdallo I will test that! |
Hi there!
I think that the current readme of the package is not set according the last update.
After running the animation the first page remains for some seconds and then the second page shows.
Sorry for my English.
Thanks in advance.
The text was updated successfully, but these errors were encountered: