0

I am trying to position my text on top of my Carousel Slider using Stack and Positioned Widget but it was staying on top of the Carousel, is there a way I can go about it.

 body: ListView(
        shrinkWrap: true,
        children: [
          Stack(
            alignment: Alignment.center,
            children: [
              Positioned(
                child: Text('TOP OFFERS / DISCOUNT'))
            ],
          ),
          Container(
            height: 150,
            width: double.infinity,
            color: HexColor("ffa400"),
            child:
           // Column(
             // children: [
                CarouselSlider.builder(
                  options: CarouselOptions(
                      height: 140,
                      autoPlay: true,
                      viewportFraction: 0.8,
                      enlargeCenterPage: true,
                      onPageChanged: (index, reason) {
                        setState(() {
                          activeIndex = index;
                        });
                      }),
                  itemCount: firstImages.length,
                  itemBuilder: (context, index, realIndex) {
                    final firstImage = firstImages[index];

                    return Column(
                      children: [
                        Expanded(child: buildImage(firstImage, index)),
                        buildIndicator(),
                      ],
                    );
                  },
                ),
Samson
  • 19
  • 1
  • 5

1 Answers1

0

Use Column instead of ListView

Rohit Krishna
  • 192
  • 2
  • 11
  • I don't mean at the top of it, I mean it should be right in the face – Samson Jul 08 '22 at 13:28
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 10 '22 at 13:06