-
-
Notifications
You must be signed in to change notification settings - Fork 305
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
Error in first run after upgrade to v3.0.0 #168
Comments
same issue |
I'm sorry to see this. Honestly, this should be impossible because I am unable to reproduce this problem. Are you able to reproduce this with the @kw2019ltd Are you using Windows for an Android target too? What Android device target are you using? |
Yes, I use windows 10
|
@sahmadreza, did you try |
Yes , I tried again and the error is still there
Is there a problem with the dart version? |
@sahmadreza Can you please confirm:
I have a hypothesis that this is related to this line: Animated-Text-Kit/lib/src/animated_text.dart Line 220 in ef52c3f
However, I am not experiencing an issue with Android or the iOS Simulator on my Mac. If this issue is limited to Windows, I wonder if this is really a Flutter bug because Flutter should be consistent across platforms. |
I submitted PR #169 that refactors the initialization sequence. I highly suspect that the PR addresses this issue. If it does not, then I suspect a Flutter bug with Windows. |
Version 3.0.1 has been released: https://pub.dev/packages/animated_text_kit/changelog 🎉 |
working fine now no issue thanks |
@alittlebitofit Thanks for the feedback. Can you please confirm if you can recreate this issue with the |
@kw2019ltd OK, excellent, good news! 🎉 |
I got the same error with My platform
My codeI tried two approaches but neither worked. Approach 1TypewriterAnimatedTextKit(
text: ['Some Text Here'],
textStyle: TextStyle(
fontSize: 45.0,
fontWeight: FontWeight.w900,
),
) Approach 2AnimatedTextKit(
animatedTexts: [
TypewriterAnimatedText(
'Some Text Here',
textStyle: TextStyle(
fontSize: 45.0,
fontWeight: FontWeight.w900,
),
),
],
) Error message:
|
@AlienKevin Are you able to reproduce this issue with the I am unable to reproduce this issue. I maintain that it should be impossible because |
Having the same issue
|
@AnirudhKK Can you share your environment? (OS, Flutter channel, Device Target?) Also, are you able to reproduce this with the |
Flutter 1.22.4 • channel stable • Android • Huawei JKM LX1 . Will let you know if I can reproduce it on example app. |
@AnirudhKK Are you using a Mac or Windows or Linux? |
Windows 10 Pro 20H2 |
@awhitford again got the same error on Flutter Counter App
https://gist.github.com/AnirudhKK/3d932bce33ee7e672907068d0e7ba23d |
@AnirudhKK I appreciate the feedback. I used the same code from your gist, but am still unable to reproduce or even logically explain how this could be possible. Since you can recreate it... Can you try adding a breakpoint on lines 40 and 65: Animated-Text-Kit/lib/src/typewriter.dart Line 40 in 1a1f7ad
Animated-Text-Kit/lib/src/typewriter.dart Line 65 in 1a1f7ad
Then, are you seeing the breakpoint on line 65 stop before line 40? (Because that shouldn't be the case. Line 40 should execute before line 65, so the Line 40 should be called once when the widget is added to the tree. Then, line 65 is called frequently during |
I'm getting this error as well with // @dart=2.9
import 'package:animated_text_kit/animated_text_kit.dart';
import 'package:flutter/material.dart';
class Home extends StatefulWidget {
Home({Key key}) : super(key: key);
@override
_HomeState createState() => _HomeState();
}
class _HomeState extends State<Home> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.black,
body: Center(
child: SizedBox(
width: 250.0,
child: TypewriterAnimatedTextKit(
onTap: () {
print("Tap Event");
},
text: [
"Discipline is the best tool",
"Design first, then code",
"Do not patch bugs out, rewrite them",
"Do not test bugs out, design them out",
],
textStyle: TextStyle(fontSize: 30.0, fontFamily: "Agne"),
textAlign: TextAlign.start,
),
),
),
);
}
} Flutter 1.25.0-9.0.pre.42 • channel master • https://github.com/flutter/flutter.git Running on macOS as a target device |
@awhitford, Adding a Update: This does cause animations to restart on setState if they're on the same page as the key. Going to move it upwards and see if that helps |
hi sorry still getting same issue I/flutter (11202): The getter 'value' was called on null. |
@kw2019ltd did you hot restart already? |
@awhitford Thanks for the response.
Ok, I'll share the source code: https://pastebin.com/MaUcqn0B And this is the error output: https://pastebin.com/zMYwDfjb PS: I'm on flutter channel beta, and |
I was finally able to reproduce this issue last night after switching to the dev channel. I can trigger this issue and clearly see that |
Another issue I noticed is that if you did a set state while an animation is running, all the words in the animation receive null values for their fade in, fade out, duration, etc. |
I have distilled the issue down to a leaner reproducible test case, but still cannot explain what is going on. I may have discovered a Flutter bug, but odds are that I am just not seeing the issue. I ended up posting the issue on Stack Overflow for feedback: https://stackoverflow.com/questions/65285189/flutter-animatedbuilder-builder-bug |
Example appAll animations work seamlessly My appNoSuchMethodError CodeP.S. I tried removing my own class WelcomeScreen extends StatefulWidget {
static String id = 'welcome';
@override
_WelcomeScreenState createState() => _WelcomeScreenState();
}
class _WelcomeScreenState extends State<WelcomeScreen>
with SingleTickerProviderStateMixin {
AnimationController controller;
Animation<Color> animation;
@override
void initState() {
super.initState();
controller = AnimationController(
duration: Duration(milliseconds: 500),
vsync: this,
);
animation = ColorTween(begin: Colors.blueGrey, end: Colors.white)
.animate(controller);
controller.addListener(() {
setState(() {});
});
controller.forward();
}
@override
void dispose() {
super.dispose();
controller.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: animation.value,
body: Padding(
padding: EdgeInsets.symmetric(horizontal: 24.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Row(children: <Widget>[
TypewriterAnimatedTextKit(
text: ['Flash Chat'],
textStyle: TextStyle(
fontSize: 45.0,
fontWeight: FontWeight.w900,
),
),
]),
],
),
),
);
}
} |
Update: I now understand what is happening. 🎉 |
What's the basic issue? Maybe I know a good workaround to save some work? |
Thank you @ThinkDigitalSoftware for the offer. My biggest issue was that I was unable to reproduce this, but I knew it was real because so many complained. I now can reliably recreate the bug. In fact, it's so easy now that I'm astonished I didn't expose this issue before. (Testing definitely needs to be tweaked.) See the SO article. Basically, I built a fix that works. However, as I was transforming each implementation, it occurred to me whether I should simply make Part of me would like to experiment with flutter_hooks, but the other part of me would like to avoid adding a dependency. An annoying thing about this solution is that I ultimately need to tweak each I hope to resolve this today. |
You should look into using keys to maintain state. Adding them in the right place helps widgets identify their states and keeps them from rebuilding from scratch. This could solve everything. It definitely reduced the number of times I encountered this issue, but I'm not sure I put them in the right place and I didn't try modifying your library with these to test it |
I did some experimentation with adding Keys in the beginning, but now that I understand the problem, it won't solve this particular problem. I need to segregate the State so that it gets maintained. |
Update: PR #176 fixes this issue. 🎉 🎉 🎉 I updated the I appreciate everyone's feedback, help, and patience. @aagarwal1012 Let's work on releasing 3.0.2. |
Version 3.0.2 has been released! - https://pub.dev/packages/animated_text_kit/changelog |
yay i updated to 3.0.2 and it works finally! thank you ^^ |
Hi,
After updating the plugin version from 2.5.4 to 3.0.0, an error will be displayed below the first run.
But after a few seconds the animation starts and works
I did not change the code and just updated the plugin and after the update this problem occurred
My Code:
Expected behavior
(package:animated_text_kit/src/fade.dart:45:24) :
Screenshots
https://i.imgur.com/2s1nTEo.png
Flutter:
Flutter (Channel stable, 1.22.4, on Microsoft Windows [Version 10.0.18363.1082], locale en-US)
Dart:
Android Studio.
The text was updated successfully, but these errors were encountered: