Flutter for Beginners
上QQ阅读APP看书,第一时间看更新

Generics

The <..> syntax is used to specify the type supported by a collection. If you look at the previous examples of lists and maps, you will notice that we have not specified any type. This is because they are optional, and Dart can infer the type based on elements during the collection initialization. 

Check this chapter's source code on GitHub for examples on collections and generics. Remember, if the Dart analyzer tool cannot infer the type, it assumes the dynamic type.