Dart newbie question.
List is a child class of Iterable, and some list methods return Iterable instead of List, e.g., List's where method. If we declare a variable as List, we have to call toList in many places.
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.
Edits
After changing some List to Iterable in my codebase, I found Iterable instances have no add method. It is used to be iterated only, as the name suggests. So obvious.