title: Searching a List of objects for a particular object in dart using "where"
body: <p>I would like to obtain an object from a List based on a specific search criteria of its member variable</p>
  
  <p>this is the code I am using</p>
  
  <pre><code>class foo
  {
    foo(this._a);
    int _a;
  }
  
  List&lt;foo&gt; lst = new List&lt;foo&gt;();
  
  main()
  {
    foo f = new foo(12);
  
    lst.add(f);
    List&lt;foo&gt; result = lst.where( (foo m) {
      return m._a == 12;
    });
  
    print(result[0]._a);
  }
  </code></pre>
  
  <p>I am getting the error and not sure how to resolve this</p>
  
  <p>Uncaught exception:</p>
  
  <pre><code>TypeError: Instance of 'WhereIterable&lt;foo&gt;': type 'WhereIterable&lt;foo&gt;' is not a subtype of type 'List&lt;foo&gt;'
  </code></pre>
  
  <p>I am trying to search for an object whose member variable <code>a == 12</code>. Any suggestions on what I might be doing wrong ?</p>