title: Dart: Iterable<E> vs. List<E>, always use Iterable?
body: <p>Dart newbie question. </p>
  
  <p>List is a child class of Iterable, and some list methods return Iterable instead of List, e.g., List's <a href="https://api.dartlang.org/stable/2.0.0/dart-core/Iterable/where.html" rel="noreferrer">where method</a>. If we declare a variable as List, we have to call <code>toList</code> in many places.</p>
  
  <p>Is it better to always declare our variable as Iterable type instead of List (or any other subtypes), so our code is generic and easy to change? Is there any downside of doing so? This is more like a best practice question.</p>
  
  <p>Edits</p>
  
  <p>After changing some List to Iterable in my codebase, I found Iterable instances have no <code>add</code> method. It is used to be <em>iterated</em> only, as the name suggests. So obvious.</p>