-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
AnimationController : The named parameter 'vsync' isn't defined. #63486
Comments
animation_controller.dart
The "required" is missing @ annotation. |
@sethchhim Nice observation, I just saw that, yep, it's missing an '@' annotation in
|
Hi @sethchhim |
This issue happend again in
|
Could everyone who still has this problem please file a new issue with the exact description of what happens, logs, and the output of |
We can but this looks like a simple regression in Flutter channel stable 1.22.0 The problem is exactly as described above by @sethchhim and confirmed by @ishandeveloper , there is an I have just upgraded to 1.22.0 and now get this error, adding the @ fixes it. [√] Android toolchain - develop for Android devices (Android SDK version 29.0.2) [√] Android Studio (version 4.0) [√] VS Code (version 1.49.2) [√] Connected device (1 available) • No issues found! |
Hi @GrahamDi code sampleimport 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
home: VsyncIssue(),
);
}
}
class VsyncIssue extends StatefulWidget {
@override
_VsyncIssueState createState() => _VsyncIssueState();
}
class _VsyncIssueState extends State<VsyncIssue>
with SingleTickerProviderStateMixin {
AnimationController _animationController;
@override
void initState() {
_animationController =
AnimationController(duration: Duration(milliseconds: 500), vsync: this);
_animationController.forward();
_animationController.addListener(() => setState(() {}));
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Container(
color: Colors.black,
width: _animationController.value * 100,
height: _animationController.value * 100,
),
),
);
}
}
flutter doctor -v[✓] Flutter (Channel stable, 1.22.0, on Microsoft Windows [Version 10.0.19041.508], locale en-US)
• Flutter version 1.22.0 at C:\Code\flutter_stable
• Framework revision d408d302e2 (3 days ago), 2020-09-29 11:49:17 -0700
• Engine revision 5babba6c4d
• Dart version 2.10.0
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at C:\Code\sdk
• Platform android-30, build-tools 30.0.2
• ANDROID_HOME = C:\Code\sdk
• Java binary at: C:\Code\android-studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.
[✓] Android Studio (version 4.0)
• Android Studio at C:\Code\android-studio
• Flutter plugin version 50.0.1
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[✓] VS Code (version 1.49.2)
• VS Code at C:\Users\Taha\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.15.0
[✓] Connected device (2 available)
• RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64 • Android 10 (API 29)
• Android SDK built for x86 64 (mobile) • emulator-5554 • android-x64 • Android 9 (API 28) (emulator)
• No issues found! |
Hey there, I'm the one who opened this issue earlier and saw a notification, cuz somone pinged me. I'm not near my PC, rn. I will share the However a week ago when I switched to the beta and then later on the to the master channel to test out Flutter Web, This issue was again reproducible on that production project, which was working fine in the stable channel. I will share more logs and other details, once I reach back home. |
I still see this issue unless I add the @ back at line 242 of animation_controller.dart. I can't comment on why you guys are not seeing it. I don't use anything other than stable so swapping and swapping back (which weirdly seems to fix some people's problems) is not something I do. I use VSCode only. Update |
Seems flutter upgrade have problems. I remove old directory and download a fresh one, it's working fine. |
So guys, this happened to me also. but I do not recomend to add "@" on animation_controller.dart, as set before migrate animation to null safety Just run |
This happened to me right now after I switched back from beta to stable channel. |
This comment was marked as spam.
This comment was marked as spam.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
It has been around 5 days since I updated to the
1.21.0-8.0.pre.76
version of flutter. I was trying to add an AnimationController to one of the widgets of my app, and when I tried to pass a TickerProvider to the vsync parameter, the dart analyzer started throwing up an error that The named parameter 'vsync' isn't defined.If I don't pass a vsync paramter however, the flutter engine will throw up an assertion error that no vsync is passed. I tried to ignore the errors and running directly in debug mode, and the app works just fine. But, it throws up these random errors and just wouldn't allow me to use my IDE's built in debugger or dart devTools.
I tried a similar thing before I had upgraded to flutter 1.20 release, and it worked just perfectly, as you'd expect it to.
Steps to Reproduce
vsync:this
as a parameter.or you can just copy-paste this code from below or this dartPad.
Screenshots
Logs
flutter analyze --verbose
flutter doctor -v
The text was updated successfully, but these errors were encountered: