Mohamed Gamal Mohamed
Mohamed Gamal Mohamed

Reputation: 103

Automatic swipe items (cards) in Flutter

I want to make something like in this picture

swipeable items

or this

2nd gid

but I want to make it swipe automatically using Flutter

I don't know if there's a widget that can help me or any package that implement it.

Upvotes: 1

Views: 1197

Answers (2)

Ravindra S. Patil
Ravindra S. Patil

Reputation: 14885

Try below code Without any package scroll list left to right or vice-versa or you can used carousel_slider package or flutter_image_slideshow package or card_swiper

 ListView.builder(
      shrinkWrap: true,
      scrollDirection: Axis.horizontal,
      itemCount: 10,
      itemBuilder: (context, index) {
        return Container(
          margin: const EdgeInsets.all(10),
          width: 200,
          height: 200,
          child: Card(
            shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(10),
            ),
            elevation: 5,
            child: Center(
              child: Text(
                'Card $index',
                style: const TextStyle(
                  fontSize: 20,
                  color: Colors.black,
                  fontWeight: FontWeight.bold,
                ),
              ),
            ),
          ),
        );
      },
    ),

Result -> image

Upvotes: 1

Abdulkadir
Abdulkadir

Reputation: 56

You can check the carousel_slider package in pub.dev. It does the scrolling automatically

Upvotes: 1

Related Questions