title: use Flutter bloc to fetch data from Api in Listview element
body: <p>I am trying to fetch data from two different APIs where the second depends on the first API as follows:
  the first API: it is used to get the city id by its name, so I have to write the city name and the API will return the city id.
  the second API: is used to get the city image by its id, so I have to enter the city id to get the city image.
  I used Flutter bloc in my app to manage interfaces and their states, as follows:</p>
  
  <pre><code>BlocBuilder&lt;FirstApiBloc, CityState&gt;(
      builder: (context, state) {
        if (state is CitiesIdsLoaded) {
          List&lt;CityDetail&gt; citiesList = state.citiesDetails;
  
          return ListView.builder(
            itemCount: citiesList.length,
            itemBuilder: (context, index) {
               BlocProvider.of&lt;CityPhotoBloc&gt;(context).add(LoadCityPhoto( 
              cityId: hotelsList[index].id.toString()));
  
              return Card(
                child: Container(
                  padding: EdgeInsets.all(15),
                  child:
          BlocBuilder&lt;CityPhotoBloc, CityPhotoState&gt;(
                        builder: (context, state) {
                          if (state is PhotoCityLoaded) {
                            return Image.network(state.photosUrl);
                          } else 
                          return Container();
                        },
                      ),
  </code></pre>
  
  <p>as you can see in the snippet above, I used </p>
  
  <pre><code> BlocProvider.of&lt;CityPhotoBloc&gt;(context).add(LoadCityPhoto( 
              cityId: hotelsList[index].id.toString()));
  </code></pre>
  
  <p>to fetch the photo for every city in the listview, But the problem is that all the images shown in the list are the same image because all the elements of the list depend on one state and that changes in each element in the list when BlocProvider is called as shown in the snippet, what should i do to get the image for each element in the listview.</p>