As you guys read on the title isn't updating somehow. It just does when I do a hot reload and I don't want that. I'm expecting when slide a image to left or right with my finger the dot indicator have to follow. Pls help and thanks in advance. Here is my code of Carousel and the dot indicator:
final urlImages1 = [
'https://i.imgur.com/Y3UejT0.jpg',
'https://i.imgur.com/KNFL3qd.jpg',
'https://i.imgur.com/fxAH9HY.jpg',
'https://i.imgur.com/9GkgdKx.jpg',
];
int currentIndex = 0;
child: Column(
children: [
CarouselSlider.builder(
itemCount:
urlImages1.length,
itemBuilder: (context,
index, realIndex) {
final urlImage01 =
urlImages1[index];
return buildImage(
urlImage01,
index);
},
options:
CarouselOptions(
height: 300,
enlargeStrategy:
CenterPageEnlargeStrategy
.height,
enlargeCenterPage:
true,
onPageChanged:
(index,
reason) {
setState(() {
currentIndex =
index;
});
}),
),
SizedBox(
height: 10,
),
dotIndicator(),
],
),
Widget dotIndicator() => AnimatedSmoothIndicator(
activeIndex: currentIndex,
count: urlImages1.length,
effect: JumpingDotEffect(
dotHeight: 10,
dotWidth: 10,
dotColor: Colors.grey,
activeDotColor: Colors.green),
);
Edit: In short the dots under this image do not move when I slide a image. Only with a hot reload.