title: How to convert a type named "LIstEntries" to iterable<ListEntries>
body: <p>I am trying to create a search function in my app and I am getting many issues due to type conversions. The search is to be done in a ListView of many entries and for that I created a class named ListEntries.</p>
  <p>This is the code of the screen that makes the search in this list of Entries:</p>
  <pre><code>import 'package:flutter/material.dart';
  import 'listentries.dart';
  
  class searchScreen extends StatefulWidget {
    final String searchTerm;
    searchScreen({this.searchTerm});
  
    @override
    _SearchScreenState createState() =&gt; new _SearchScreenState();
  }
  
  class _SearchScreenState extends State&lt;searchScreen&gt; {
    @override
    Widget build(BuildContext context) {
      final widgetElements = new ListEntries(); // From listentries.dart
      var searchedItems = widgetElements;
  
      String entry;
  
      entry = searchedItems.toString();
  
      final duplicateItems = List&lt;String&gt;.generate(10000, (i) =&gt; &quot;Item $i&quot;);
      var items = List&lt;String&gt;();
  
      void filterSearchResults(String query) {
        List&lt;ListEntries&gt; dummySearchList = List&lt;ListEntries&gt;();
  
        dummySearchList.addAll(searchedItems);
        if (query.isNotEmpty) {
          List&lt;ListEntries&gt; dummyListData = List&lt;ListEntries&gt;();
          dummySearchList.forEach((item) {
            if (item.contains(query)) {
              dummyListData.add(item);
            }
          });
          setState(() {
            items.clear();
            items.addAll(dummyListData);
          });
          return;
        } else {
          setState(() {
            items.clear();
            items.addAll(duplicateItems);
          });
        }
      }
  
      return Scaffold(
        appBar: AppBar(
          backgroundColor: Colors.black,
          title: Text(
            &quot;Search your term&quot;,
            style: TextStyle(fontSize: 20),
          ),
        ),
        body: Container(
          child: Column(
            children: &lt;Widget&gt;[
              Padding(
                  padding: const EdgeInsets.all(8.0),
                  child: TextField(
                    onChanged: (value) {
                      filterSearchResults(value);
                    },
                    decoration: InputDecoration(
                        labelText: 'Search',
                        hintText: 'Search your term',
                        suffixIcon: Icon(Icons.search),
                        border: OutlineInputBorder(
                            borderRadius:
                                BorderRadius.all(Radius.circular(25.0)))),
                  )),
              Expanded(
                child: searchedItems,
              ),
            ],
          ),
        ),
        // bottomNavigationBar: bannerAd,
      );
    }
  }
  
  </code></pre>
  <p>The Type LisEntries is defined in this other file (listentries.dart):</p>
  <pre><code>import 'dart:convert';
  import 'package:flutter/material.dart';
  import 'package:flutter/foundation.dart';
  import 'destination.dart';
  import 'package:insurance_dictionary/facebook_code.dart';
  import 'dart:io';
  
  class ListEntries extends StatefulWidget {
    ListEntries({Key key}) : super(key: key);
  
    @override
    ListEntriesState createState() =&gt; ListEntriesState();
  }
  
  class ListEntriesState extends State&lt;ListEntries&gt; {
    bool isFirstUse = true;
    int numUses = 0;
    int cycle = 5;
    //static FutureBuilder&lt;String&gt; listOfEntries;
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        body: Container(
          child: Center(
            child: FutureBuilder(
              future:
                  DefaultAssetBundle.of(context).loadString('assets/data.json'),
              builder: (context, snapshot) {
                var entries = json.decode(snapshot.data.toString());
                //listOfEntries = entries;
                return ListView.builder(
                  shrinkWrap: true,
                  itemBuilder: (BuildContext context, int index) {
                    var entrada = entries[index];
                    return Container(
                      margin: EdgeInsets.symmetric(vertical: 2.0),
                      color: Colors.transparent,
                      width: MediaQuery.of(context).size.width,
                      height: 60,
                      child: RaisedButton(
                        shape: new RoundedRectangleBorder(
                          borderRadius: new BorderRadius.circular(30.0),
                        ),
                        onPressed: () {
                          if ((isFirstUse) || (numUses % cycle == 0)) {
                            loadInterstitialAd();
                            sleep(Duration(milliseconds: 100));
                            showInterstitialAd();
                            isFirstUse = false;
                            numUses++;
                          } else {
                            numUses++;
                            Navigator.push(
                              context,
                              MaterialPageRoute(
                                builder: (context) =&gt; Destination(
                                  entry: entrada['Entry'],
                                  definition: entrada['Definition'],
                                ),
                              ),
                            );
                          }
                        },
                        color: Colors.blue[900],
                        child: Text(
                          entrada['Entry'],
                          style: TextStyle(
                            color: Colors.white,
                            fontFamily: 'Raleway',
                            fontSize: 18.0,
                          ),
                        ),
                      ),
                    );
                  },
                  itemCount: entries == null ? 0 : entries.length,
                );
              },
            ),
          ),
        ),
      );
    }
  }
  
  </code></pre>
  <p>The errors that I am getting are located in these steps in the search_entries.dart file:</p>
  <pre><code>dummySearchList.addAll(searchedItems);
  
  items.addAll(dummyListData);
  </code></pre>
  <p>Both errors say: &quot;The argument type 'List' can't be assigned to the parameter type 'Iterable'.&quot;</p>
  <p>There is another error in this step:</p>
  <pre><code> if (item.contains(query)) {...}
  </code></pre>
  <p>In this case, the error says: &quot;The method 'contains' isn't defined for the type 'ListEntries'.&quot;</p>
  <p>I have been fighting with this kind of errors for several days.  Could you give a good advice?
  Thanks.</p>