[framework] create animation from value listenable#108644
Merged
auto-submit[bot] merged 9 commits intoflutter:masterfrom Jul 30, 2022
Merged
[framework] create animation from value listenable#108644auto-submit[bot] merged 9 commits intoflutter:masterfrom
auto-submit[bot] merged 9 commits intoflutter:masterfrom
Conversation
Contributor
Author
|
The idea with this is that instead of: You can do: |
goderbauer
approved these changes
Jul 29, 2022
Member
goderbauer
left a comment
There was a problem hiding this comment.
LGTM
Seems like a useful API.
| import 'package:flutter_test/flutter_test.dart'; | ||
|
|
||
| void main() { | ||
|
|
| /// | ||
| /// The returned animation will always have an animations status of | ||
| /// [AnimationStatus.forward]. The value of the provided listenable can | ||
| /// be optionally transformed using the [transformer] function. |
Member
There was a problem hiding this comment.
Bonus points if you add the example from this comment here to showcase the API and how it can simplify things.
goderbauer
approved these changes
Jul 29, 2022
Member
goderbauer
left a comment
There was a problem hiding this comment.
Here are the bonus points: 🌟🌟🌟🌟🌟
| /// }, | ||
| /// child: Container( | ||
| /// child: Text('Hello, Animation'), | ||
| /// ), |
Member
There was a problem hiding this comment.
nit: the analyzer will hopefully tell you, but I think this is missing a closing ) for the ValueListenableBuilder?
| /// }) | ||
| /// child: Container( | ||
| /// child: Text('Hello, Animation'), | ||
| /// ), |
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Jul 30, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jul 30, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Jul 30, 2022
camsim99
pushed a commit
to camsim99/flutter
that referenced
this pull request
Aug 10, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've noticed a number of patterns in a certain customer app, where there is a desire to animate some part of the UI (opacity for example) based on something that is available via a value listenable (scroll position). Because there is no easy way to create an animation from a value listenable, I see a lot of ValueListenableBuilders used to animate things that could be FadeTransitions. This has the distinct disadvantage of bypassing the repaint boundary mechanisms introduced into animated opacities.