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. 

dev_dependencies:
  flutter_test:
    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 = ["https://images.unsplash.com/photo-1520342868574-5fa3804e551c?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=6ff92caffcdd63681a35134a6770ed3b&auto=format&fit=crop&w=1951&q=80",
  'https://images.unsplash.com/photo-1523205771623-e0faa4d2813d?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=89719a0d55dd05e2deae4120227e6efc&auto=format&fit=crop&w=1953&q=80',
  'https://images.unsplash.com/photo-1508704019882-f9cf40e475b4?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=8c6e5e3aba713b17aa1fe71ab4f0ae5b&auto=format&fit=crop&w=1352&q=80',
  'https://images.unsplash.com/photo-1519985176271-adb1088fa94c?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=a0c8d632e977f94e5d312d9893258f59&auto=format&fit=crop&w=1355&q=80'];

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.

Container(
  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),
            child: Image.network(
              imageList[i],
            width: 500,
            fit: BoxFit.cover,
            ),
          ),
        ),
        onTap: (){
          var url = imageList[i];
          print(url.toString());
        },
      );
    },
  ),
),

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 pub.dev 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.


close

Don’t miss new tips!

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

204 thoughts on “Carousel Image Slider In Flutter Example”

  1. Pingback: https://canadianpharmaceuticalsonline.home.blog/

  2. Pingback: reallygoodemails.comonlineviagra

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

  4. Pingback: viagraonlineee.wordpress.com

  5. Pingback: where to buy viagra online

  6. Pingback: https://viagraonlinee.livejournal.com/492.html

  7. Pingback: buy viagra online no prescription

  8. Pingback: buy viagra online

  9. Pingback: https://www.kadenze.com/users/canadian-pharmaceuticals-for-usa-sales

  10. Pingback: linktr.eecanadianpharmaceuticalsonline

  11. Pingback: disqus.comhomeforumcanadian-pharmaceuticals-online

  12. Pingback: 500px.compcanadianpharmaceuticalsonline

  13. Pingback: https://dailygram.com/index.php/blog/1155353/we-know-quite-a-bit-about-covid-19/

  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: pinshape.com/users/2441621-canadian-pharmaceutical-companies

  23. Pingback: buy viagra now

  24. Pingback: northwest pharmacies

  25. Pingback: https://pinshape.com/users/2445987-order-stromectol-over-the-counter

  26. Pingback: https://reallygoodemails.com/orderstromectoloverthecounter

  27. Pingback: https://challonge.com/en/orderstromectoloverthecounter

  28. Pingback: https://500px.com/p/orderstromectoloverthecounter

  29. Pingback: https://www.seje.gov.mz/question/order-stromectol-over-the-counter-6/

  30. Pingback: canadajobscenter.comauthorbuystromectol

  31. Pingback: online canadian pharmacy

  32. Pingback: https://aoc.stamford.edu/profile/canadianpharmaceuticalsonline/

  33. Pingback: northwest pharmacy canada

  34. Pingback: ktqt.ftu.edu.vnenquestion listcanadian-pharmaceuticals-for-usa-sales

  35. Pingback: discount canadian pharmacies

  36. Pingback: stromectol scabies treatment

  37. Pingback: ktqt.ftu.edu.vnenquestion listorder-stromectol-over-the-counter-10

  38. Pingback: orderstromectoloverthecounter.bandcamp.comreleases

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

  40. Pingback: https://www.repairanswers.net/question/order-stromectol-over-the-counter-2/

  41. Pingback: https://www.repairanswers.net/question/stromectol-order-online/

  42. Pingback: canadajobscenter.comauthorarpreparof1989

  43. Pingback: aoc.stamford.eduprofilegoatunmantmen

  44. Pingback: web904.comstromectol-buy

  45. Pingback: https://web904.com/buy-ivermectin-online-fitndance/

  46. Pingback: https://glycvimepedd.bandcamp.com/releases

  47. Pingback: https://canadajobscenter.com/author/ereswasint/

  48. Pingback: https://aoc.stamford.edu/profile/hispennbackwin/

  49. Pingback: bursuppsligme.bandcamp.comreleases

  50. Pingback: https://pinshape.com/users/2461310-canadian-pharmacies-shipping-to-usa

  51. Pingback: https://pinshape.com/users/2462760-order-stromectol-over-the-counter

  52. Pingback: https://pinshape.com/users/2462910-order-stromectol-online

  53. Pingback: 500px.com/p/phraspilliti

  54. Pingback: https://web904.com/canadian-pharmaceuticals-for-usa-sales/

  55. Pingback: https://500px.com/p/skulogovid/?view=groups

  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: https://experiment.com/users/canadianpharmacy

  64. Pingback: canada medication

  65. Pingback: stromectol generic

  66. Pingback: challonge.comgotsembpertvil

  67. Pingback: challonge.comcitlitigolf

  68. Pingback: order-stromectol-over-the-counter.estranky.czclankyorder-stromectol-over-the-counter.html

  69. Pingback: soncheebarxu.estranky.czclankystromectol-for-head-lice.html

  70. Pingback: lehyriwor.estranky.skclankystromectol-cream.html

  71. Pingback: https://dsdgbvda.zombeek.cz/

  72. Pingback: inflavnena.zombeek.cz

  73. Pingback: www.myscrsdirectory.comprofile4217080

  74. Pingback: supplier.ihrsa.orgprofile4217170

  75. Pingback: wefbuyersguide.wef.orgprofile4219140

  76. Pingback: canadian pharmacy viagra

  77. Pingback: https://moaamein.nacda.com/profile/422018/0

  78. Pingback: https://www.audiologysolutionsnetwork.org/profile/422019/0

  79. Pingback: https://network.myscrs.org/profile/422020/0

  80. Pingback: sanangelolive.commemberscanadianpharmaceuticalsonlineusa

  81. Pingback: purchase stromectol

  82. Pingback: https://www.ecosia.org/search?q="My Canadian Pharmacy - Extensive Assortment of Medications – 2022"

  83. Pingback: www.mojomarketplace.comuserCanadianpharmaceuticalsonline-EkugcJDMYH

  84. Pingback: https://seedandspark.com/user/canadian-pharmaceuticals-online

  85. Pingback: www.giantbomb.comprofilecanadapharmacyblogcanadian-pharmaceuticals-online265652

  86. Pingback: canadian pharmacy uk delivery

  87. Pingback: canadian cialis

  88. Pingback: https://search.seznam.cz/?q="My Canadian Pharmacy - Extensive Assortment of Medications – 2022"

  89. Pingback: stromectol

  90. Pingback: https://duckduckgo.com/?q="My Canadian Pharmacy - Extensive Assortment of Medications – 2022"

  91. Pingback: https://swisscows.com/en/web?query="My Canadian Pharmacy - Extensive Assortment of Medications – 2022"

  92. Pingback: https://www.dogpile.com/serp?q="My Canadian Pharmacy - Extensive Assortment of Medications – 2022"

  93. Pingback: best canadian pharmacies online

  94. Pingback: https://search.givewater.com/serp?q="My Canadian Pharmacy - Extensive Assortment of Medications – 2022"

  95. Pingback: www.bakespace.commembersprofileСanadian pharmaceuticals for usa sales1541108

  96. Pingback: canadian pharmacy online

  97. Pingback: results.excite.comserp?q="My Canadian Pharmacy - Extensive Assortment of Medications – 2022"

  98. Pingback: northwest pharmacies

  99. Pingback: canadian pharmacies online prescriptions

  100. Pingback: results.excite.comserp?q="My Canadian Pharmacy - Extensive Assortment of Medications – 2022"

  101. Pingback: https://canadianpharmaceuticalsonline.as.me/schedule.php

  102. Pingback: canadian pharmaceuticals online

  103. Pingback: https://reallygoodemails.com/orderstromectoloverthecounterusa

  104. Pingback: logarkomx

  105. Pingback: stromectol buy

  106. Pingback: pinshape.comusers2491694-buy-stromectol-fitndance

  107. Pingback: www.provenexpert.commedicament-stromectol

  108. Pingback: buy stromectol

  109. Pingback: stromectol tablets uk

  110. Pingback: https://tropkefacon.estranky.sk/clanky/buy-ivermectin-fitndance.html

  111. Pingback: best canadian pharmacies online

  112. Pingback: dramamhinca.zombeek.cz

  113. Pingback: https://sanangelolive.com/members/thisphophehand

  114. Pingback: motocom.codemosnetw5askmequestioncanadian-pharmaceuticals-online-5

  115. Pingback: www.infospace.comserp?q="My Canadian Pharmacy - Extensive Assortment of Medications – 2022"

  116. Pingback: canadianpharmacy

  117. Pingback: https://aleserme.estranky.sk/clanky/stromectol-espana.html

  118. Pingback: https://orderstromectoloverthecounter.mystrikingly.com/

  119. Pingback: stromectoloverthecounter.wordpress.com

  120. Pingback: https://buystromectol.livejournal.com/421.html

  121. Pingback: https://orderstromectoloverthecounter.flazio.com/

  122. Pingback: canada online pharmacies

  123. Pingback: https://conifer.rhizome.org/pharmaceuticals

  124. Pingback: stromectol espana

  125. Pingback: stromectol coupon

  126. Pingback: stromectol oral

  127. Pingback: orderstromectoloverthecounter.proweb.cz

  128. Pingback: orderstromectoloverthecounter.nethouse.ru

  129. Pingback: sandbox.zenodo.orgcommunitiescanadianpharmaceuticalsonline

  130. Pingback: demo.socialengine.comblogs24031227canadian-pharmaceuticals-online

  131. Pingback: pharmaceuticals.cgsociety.orgjvcccanadian-pharmaceuti

  132. Pingback: https://taylorhicks.ning.com/photo/albums/best-canadian-pharmaceuticals-online

  133. Pingback: my.afcpe.orgforumsdiscussiondiscussionsreputable-canadian-pharmaceuticals-online

  134. Pingback: www.dibiz.comndeapq

  135. Pingback: pharmacy canada

  136. Pingback: https://canadianpharmaceuticals.educatorpages.com/pages/canadian-pharmacies-shipping-to-usa

  137. Pingback: https://soundcloud.com/canadian-pharmacy

  138. Pingback: canadian pharmacy

  139. Pingback: canadian online pharmacy

  140. Pingback: dragonballwiki.netforumcanadian-pharmaceuticals-online-safe

  141. Pingback: the-dots.comprojectscovid-19-in-seven-little-words-848643

  142. Pingback: jemi.socanadian-pharmacies-shipping-to-usa

  143. Pingback: www.homify.comideabooks9099923reputable-canadian-pharmaceuticals-online

  144. Pingback: buy viagra online usa

  145. Pingback: viagra canada

  146. Pingback: pinshape.comusers2507399-best-canadian-pharmaceuticals-online

  147. Pingback: https://aoc.stamford.edu/profile/upogunem/

  148. Pingback: canadian pharmacies mail order

  149. Pingback: canadian medications

  150. Pingback: best canadian pharmacies online

  151. Pingback: canada pharmacies online prescriptions

  152. Pingback: https://dustpontisrhos.zombeek.cz/

  153. Pingback: sanangelolive.commembersmaiworkgendty

  154. Pingback: issuu.comlustgavalar

  155. Pingback: https://calendly.com/canadianpharmaceuticalsonline/onlinepharmacy

  156. Pingback: canadianpharmaceuticalsonline.golog.jparchives16914921.html

  157. Pingback: canadian pharmacys

  158. Pingback: pharmacy canada

  159. Pingback: https://canadianpharmaceuticalsonline.mynikki.jp/archives/16957846.html

  160. Pingback: pinshape.comusers2528098-canadian-pharmacy-online

  161. Pingback: https://gravatar.com/kqwsh

  162. Pingback: canada drugs online

  163. Pingback: telegra.phCanadian-pharmacy-drugs-online-12-11

  164. Pingback: graph.orgCanadian-pharmacies-online-12-11

  165. Pingback: canadianonlinepharmacieslegitimate.flazio.com

  166. Pingback: halttancentnin.livejournal.com301.html

  167. Pingback: https://app.roll20.net/users/11413335/canadian-pharmaceuticals-online-shipping

  168. Pingback: https://linktr.ee/canadianpharmaceuticalsonlineu

  169. Pingback: onlinepharmaciesofcanada.bigcartel.combest-canadian-online-pharmacy

  170. Pingback: hub.docker.comrcanadadiscountdrugpharmaceuticals

  171. Pingback: canada pharmacy

  172. Pingback: online pharmacy

  173. Pingback: prescription drugs without prior prescription

  174. Pingback: canadian viagra

  175. Pingback: bitcoinblack.netcommunitycanadianpharmacyonlineviagrainfo

  176. Pingback: https://forum.melanoma.org/user/canadadrugsonline/profile/

  177. Pingback: [email protected]

  178. Pingback: prescription drugs without prior prescription

  179. Pingback: https://my.desktopnexus.com/Canadianpharmacygeneric/journal/

  180. Pingback: http://canadianpharmaceuticalsonlinee.iwopop.com/

  181. Pingback: top rated online canadian pharmacies

  182. Pingback: pharmacycheapnoprescription.nethouse.ru

  183. Pingback: https://www.midi.org/forum/profile/96944-pharmacyonlinecheap

  184. Pingback: canadian pharmacies shipping to usa

  185. Pingback: https://dailygram.com/blog/1183360/canada-online-pharmacies/

  186. Pingback: drugs for sale

  187. Pingback: https://rabbitroom.com/members/onlinepharmacydrugstore/profile/

  188. Pingback: https://www.mixcloud.com/canadianpharmaceuticalsonline/

  189. Pingback: www.goodreads.comusershow161146330-canadianpharmaceuticalsonline

  190. Pingback: myanimelist.netprofilecanadapharmacies

  191. Pingback: pharmacyonlineprescription.webflow.io

  192. Pingback: https://www.isixsigma.com/members/pharmacyonlinenoprescription/

  193. Pingback: slides.combestcanadianonlinepharmacies

  194. Pingback: www.mojomarketplace.comuserdiscountcanadiandrugs-f0IpYCKav8

  195. Pingback: canadianpharmaceuticalsonlinee.bandcamp.comtrackcanadian-pharmaceuticals-usa

  196. Pingback: most reliable canadian pharmacies

  197. Pingback: https://www.gamespace.com/members/canadianprescriptionsonline/

  198. Pingback: haikudeck.compresentationscanadianpharmacies

  199. Pingback: canada drug

  200. Pingback: pharmacy

  201. Pingback: haikudeck.compresentationscheapprescriptiondrugs

  202. Pingback: best canadian pharmacies online

  203. Pingback: slides.comcanadianpharmacycialis20mg

  204. Pingback: www.mojomarketplace.comusergenericviagraonline-A1mET2hm7S

Leave a Comment