-
Notifications
You must be signed in to change notification settings - Fork 28.9k
migrate animation to nullsafety #62485
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
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
@@ -414,22 +413,22 @@ class AnimationController extends Animation<double> | |||
/// and the most recent tick of the animation. | |||
/// | |||
/// If the controller is not animating, the last elapsed duration is null. | |||
Duration get lastElapsedDuration => _lastElapsedDuration; | |||
Duration _lastElapsedDuration; | |||
Duration get lastElapsedDuration => _lastElapsedDuration!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is conflicting with the doc comment above it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I now get "The named parameter 'vsync' isn't defined." when trying to use an AnimationController. Do i have to change my code or is this broken now? |
|
Its probably because the analyzer does not understand the "required" keyword? which was @required before? |
@a14n My IDE (Android Studio 4.0.1) tells me that vsync does not exist and marks this as an error. It suggests adding the vsync parameter with label "TickerProvider:" instead of "vsync:". Fun fact: It compiles when using "vsync:", and it fails to compile if i use the suggested "TickerProvider:" label. I ran "flutter clean" but it doesnt change. I will try to investigate further... |
Can you try to run |
No issues found! (ran in 12.7s;) |
So it looks like your IDE uses a version of Dart that is not the one packaged with Flutter. |
Dart SDK version: 2.10.0-1.0.dev.flutter-24c7666def (be) (Wed Jul 22 13:22:07 2020 +0000) on "macos_x64" |
Okay, to complete this and (maybe) help others: |
As nullsafety is available behind an experimental flag I would not recommand to migrate your code for now. |
* migrate animation to nullsafety * nullable tween * fix generic type issue * address review comment
* migrate animation to nullsafety * nullable tween * fix generic type issue * address review comment
Description
NNBD migration for animation
Related Issues
Tests
I added the following tests:
None
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze --flutter-repo
) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.