Stack(children: [
CarouselSlider.builder(
carouselController: controller,
itemCount: images.length,
itemBuilder: (context, index, realIndex) {
final image = images[index];
return BuildImage(image, index);
},
options: CarouselOptions(
viewportFraction: 1,
height: 200,
initialPage: 0,
reverse: false,
autoPlay: true,
)),
Container(alignment: Alignment.bottomCenter, child: buildIndicator()),
],),
Try Positioned
like this:
Stack(
children: [
CarouselSlider.builder(
carouselController: controller,
itemCount: images.length,
itemBuilder: (context, index, realIndex) {
final image = images[index];
return BuildImage(image, index);
},
options: CarouselOptions(
viewportFraction: 1,
height: 200,
initialPage: 0,
reverse: false,
autoPlay: true,
)),
Positioned(
left: 0,
right: 0,
bottom: 10,
child: buildIndicator(),
),
],
),
Give alignment to stack widget...
Stack(
alignment: AlignmentDirectional.bottomCenter,
children: [...]
)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.