Generic collections and the types they contain
Dart generic types are reified, which means that they carry their typeinformation around at runtime. For example, you can test the type of acollection:
var names = List<String>();
names.addAll(['Seth', 'Kathy', 'Lars']);
print(names is List<String>); // true
Note: In contrast, generics in Java use erasure, which means that generic type parameters are removed at runtime. In Java, you can test whether an object is a List, but you can’t test whether it’s a List<String>
.