Staram się zrealizować kod z przykładu oficjalnych dokumentów, ale to się nie uda:
...
class _MyHomePageState extends State<MyHomePage> {
late AnimationController controller;
@override
void initState() {
super.initState();
controller = AnimationController(duration: Duration(seconds: 3), vsync: this);
}
...
W nim czytamy, że: The argument type '_MyHomePageState' can't be assigned to the parameter type 'TickerProvider'.
Tak więc, VSCode podkreśla vsync: this
ust.
Mam najnowsza wersja 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
Dlaczego występuje ten błąd i jak go naprawić bez obniżenia wersji SDK?