title: Adding elements to List in Flutter from For statement?
body: <p>I'm receiving the following error while trying to add elements from my for loop to my <code>List</code>...</p>
  
  <pre><code>NoSuchMethodError: The method 'addAll' was called on null.
      Receiver: null
      Tried calling: addAll("LrWr826cd3Y")
  </code></pre>
  
  <p>Here is my code...</p>
  
  <pre><code>Future getData() async {
      //Map videoId;
  
      String url = 'https://Youtube API';
      var httpClient = createHttpClient();
      var response = await httpClient.read(url);
      Map data = JSON.decode(response);
      var videos = data['items']; //returns a List of Maps
  
      List searchTitles;
      List searchIds;
      List searchImages;
  
      for (var items in videos) {
        //iterate over the list
        Map myMap = items; //store each map
        final video = (myMap['id'] as Map);
        print(video['videoId']);
        searchIds.addAll(video['videoId']);
        final details = (myMap['snippet'] as Map);
        final videoimage = (details['thumbnails'] as Map);
        final medium = (videoimage['medium'] as Map);
  
      }
  
      setState(() { });
  
      if (!mounted) return;
    }
  </code></pre>
  
  <p><code>print(video['videoId']);</code> successfully lists the 3 Youtube video ids as Strings. <code>searchIds.addAll(video['videoId']);</code> throws the error.  I've tried both <code>searchIds.add</code> and <code>searchIds.addAll</code>.  Where am I going wrong?</p>
  
  <p>I would like to eventually push these lists to my List class here..</p>
  
  <pre><code>class CardInfo {
    //Constructor
    List id;
    List title;
    List video;
  
    CardInfo.fromJson(List json) {
      this.id;
      this.title;
      this.video;
    }
  }
  </code></pre>