Closed AmirHosseinBaderan closed 6 days ago
I think there's an issue where the controller is being reinitialized every time the build method is being executed. I found a fix to go around this by using flutter_hooks and setting the CarouselController() inside a useState variable.
final carouselController = useState(CarouselController());
and then you can use it for example like so carouselController.value.previousPage();
When using the functions of the next page and the previous page, we encounter this error from the controller.
I checked the controller codes and realized that the state is null. This is the reason we are encountering an error.