title: How to keep changing a Images every 5 seconds in Flutter?
body: <p>State Variables : </p>
  
  <pre><code>var moviePhotos = [
  "http://www.kiwithebeauty.com/wp-content/uploads/2017/11/BLACK-PANTHER-COLLAGE-KIWI-THE-BEAUTY-MOVIE-MARVEL-800x350.png",
  "https://static-ssl.businessinsider.com/image/5a7085a97e7a35f10c8b479f-1000/blackpanthershuri.jpg",
  "https://longreadsblog.files.wordpress.com/2018/02/black-panther.jpg?w=1680",
  "https://uziiw38pmyg1ai60732c4011-wpengine.netdna-ssl.com/wp-content/dropzone/2018/02/black-panther.jpg",
  "https://static2.srcdn.com/wp-content/uploads/2017/10/Black-Panther-Trailer-1.jpg?q=50&amp;w=1000&amp;h=500&amp;fit=crop&amp;dpr=1.5",
  "https://cdn.guidingtech.com/imager/media/assets/BP-2_acdb3e4bb37d0e3bcc26c97591d3dd6b.jpg",
  "https://cdn.guidingtech.com/imager/media/assets/BP-8_acdb3e4bb37d0e3bcc26c97591d3dd6b.jpg"
  ];
  var bannerPosition = 0;
  </code></pre>
  
  <p>I want the below function to change the position  in the array every 5 seconds by incrementation bannerPosition so that a new image renders on the app </p>
  
  <pre><code>testing() async {
      while(true){
          await new Future.delayed(const Duration(seconds : 5));
              if (bannerPosition &lt; moviePhotos.length){
                  print("Banner Position Pre");
                  print(bannerPosition);
                  setState(() {
                      bannerPosition = bannerPosition + 1;
                  });
                  print("Banner Position Post");
                  print(bannerPosition);                      
              }                   
              else{
                  setState(() {
                      bannerPosition = 0;
                  });                     
              }       
          }
  
  }
  </code></pre>
  
  <p>The "Future.delayed(const Duration(seconds : 5))" does not occur in an orderly fashion when I execute this code and it results in image rendering issues.</p>