Carousel Image Slider In Flutter Example

In this tutorial we will learn how to create an image slider in flutter by loading an image from the URL. To show the images in the slider we will use the carousel slider API from flutter dev website.

What is a Carousel Image Slider In Flutter?

Sometimes we want to show images in moving form, it can be from left to right or up to down. You can see these types of dynamic image sliders in amazon, flipkart or many other shopping or entertainment websites or apps.

image slider in flutter
image slider in flutter

Add The Following Dependency

Add the following dependency in your pubspec.yaml file and click on pub get. 

    sdk: flutter
  carousel_slider: ^4.0.0

Create A List Of Images

I am directly using the URL of images. You can get your images from a server like API. There is no big difference between them. We only needed the URL. Following is the list of URLs of images you can use by copy and paste in your code.

final List<String> imageList = ["",

Import The Flutter Carousel Image Slider Library In Flutter Class

Import the carousel library in your class where you are using the Carousel Image slider.

import 'package:carousel_slider/carousel_slider.dart';

Widget For Image Slider

Use Following widget in your flutter project class to create a dynamic image slider. You can manage it by wrapping Column, Row, Container or other widget for any type style. Please note that I wrapped it inside Container for better look and margin.

  margin: EdgeInsets.all(15),
  child: CarouselSlider.builder(
    itemCount: imageList.length,
    options: CarouselOptions(
      enlargeCenterPage: true,
      height: 300,
      autoPlay: true,
      autoPlayInterval: Duration(seconds: 3),
      reverse: false,
      aspectRatio: 5.0,
    itemBuilder: (context, i, id){
      //for onTap to redirect to another screen
      return GestureDetector(
        child: Container(
        decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(15),
            border: Border.all(color: Colors.white,)
          //ClipRRect for image border radius
          child: ClipRRect(
            borderRadius: BorderRadius.circular(15),
            width: 500,
            fit: BoxFit.cover,
        onTap: (){
          var url = imageList[i];

I used the GestureDetector() widget for moving into another screen by clicking on a particular image.

You can learn more about this image slider from website. There are many other sliders available for your desire. You can go by clicking here.

Please do comment if you like this tutorial even if you find any issue in this code.

Please also learn more flutter and android tutorials which will improve your development skills.


Don’t miss new tips!

We don’t spam! Read our [link]privacy policy[/link] for more info.

63 thoughts on “Carousel Image Slider In Flutter Example”

  1. Pingback:

  2. Pingback: reallygoodemails.comonlineviagra

  3. Pingback: viagraonline.estranky.skclankyviagra-without-prescription.html

  4. Pingback:

  5. Pingback: where to buy viagra online

  6. Pingback:

  7. Pingback: buy viagra online no prescription

  8. Pingback: buy viagra online

  9. Pingback:

  10. Pingback: linktr.eecanadianpharmaceuticalsonline

  11. Pingback: disqus.comhomeforumcanadian-pharmaceuticals-online

  12. Pingback: 500px.compcanadianpharmaceuticalsonline

  13. Pingback:

  14. Pingback: northwest pharmacy canada

  15. Pingback: 500px.complistofcanadianpharmaceuticalsonline

  16. Pingback: canadian pharmacy uk delivery

  17. Pingback: canadian drugs

  18. Pingback: pharmacy canada

  19. Pingback: global pharmacy canada

  20. Pingback: canadian pharmacy uk delivery

  21. Pingback: top rated online canadian pharmacies

  22. Pingback:

  23. Pingback: buy viagra now

  24. Pingback: northwest pharmacies

  25. Pingback:

  26. Pingback:

  27. Pingback:

  28. Pingback:

  29. Pingback:

  30. Pingback: canadajobscenter.comauthorbuystromectol

  31. Pingback: online canadian pharmacy

  32. Pingback:

  33. Pingback: northwest pharmacy canada

  34. Pingback: listcanadian-pharmaceuticals-for-usa-sales

  35. Pingback: discount canadian pharmacies

  36. Pingback: stromectol scabies treatment

  37. Pingback: listorder-stromectol-over-the-counter-10

  38. Pingback: orderstromectoloverthecounter.bandcamp.comreleases

  39. Pingback: www.provenexpert.comorder-stromectol-over-the-counter12

  40. Pingback:

  41. Pingback:

  42. Pingback: canadajobscenter.comauthorarpreparof1989

  43. Pingback: aoc.stamford.eduprofilegoatunmantmen

  44. Pingback: web904.comstromectol-buy

  45. Pingback:

  46. Pingback:

  47. Pingback:

  48. Pingback:

  49. Pingback: bursuppsligme.bandcamp.comreleases

  50. Pingback:

  51. Pingback:

  52. Pingback:

  53. Pingback:

  54. Pingback:

  55. Pingback:

  56. Pingback: 500px.compbersavahi?view=groups

  57. Pingback: reallygoodemails.comcanadianpharmaceuticalsonlineusa

  58. Pingback: www.provenexpert.comcanadian-pharmaceuticals-online-usa

  59. Pingback: canadian pharmacies online prescriptions

  60. Pingback: canadian medications

  61. Pingback: haikudeck.comcanadian-pharmaceuticals-online-personal-presentation-827506e003

  62. Pingback: buyersguide.americanbar.orgprofile4206420

  63. Pingback:

Leave a Comment