Flutter: Use vsync: this to report an error

Flutter: Use vsync:this to report an error Insert picture description here
1. When creating an AnimationController, you need to pass a vsync parameter. When vsync exists, it will prevent off-screen animation (animated UI is not on the current screen) from consuming unnecessary resources.
2. By adding SingleTickerProviderStateMixin to the class definition, the stateful object can be used as the value of vsync. If you want to use a custom State object as vsync, please include TickerProviderStateMixin.
Insert picture description here
Use the with keyword followed by one or more mixin names to implement the mixin

Guess you like

Origin blog.csdn.net/weixin_46005137/article/details/107166508