Using parameterized types with constructors
To specify one or more types when using a constructor, put the types inangle brackets (<…>
) just after the class name. For example:
var nameSet = Set<String>.from(names);
The following code creates a map that has integer keys and values oftype View:
var views = Map<int, View>();