I have an initState() method and contains AnimationController as the below code:
_controller = AnimationController(
vsync: this,
duration: const Duration(
milliseconds: 2500,
),
);
for example I want to use as the below way:
import 'package:get/get.dart';
import 'package:flutter/material.dart';
class ControllerViewModel extends GetxController {
AnimationController _controller;
@override
void onInit() {
// TODO: implement onInit
super.onInit();
_controller = AnimationController(
vsync: this,
duration: const Duration(
milliseconds: 2500,
),
);
}
}
but of course I found an error with The argument type 'ControllerViewModel' can't be assigned to the parameter type 'TickerProvider'.
So there's a way to use this AnimationController in GetX state management way?