Estou tentando implementar o código de oficial docs exemplo , mas não consegue:
...
class _MyHomePageState extends State<MyHomePage> {
late AnimationController controller;
@override
void initState() {
super.initState();
controller = AnimationController(duration: Duration(seconds: 3), vsync: this);
}
...
Ele diz que: The argument type '_MyHomePageState' can't be assigned to the parameter type 'TickerProvider'.
Assim, VSCode destaques vsync: this
param.
Eu tenho a versão mais recente do Flutter:
Flutter 2.5.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 18116933e7 (6 weeks ago) • 2021-10-15 10:46:35 -0700
Engine • revision d3ea636dc5
Tools • Dart 2.14.4
Por que este erro ocorre e como resolver isso sem fazer o downgrade de versão do SDK?