1 | initial version |
Dart does not have a built-in support for generics using typedefs
. This is because typedefs
are simply aliases for existing types, and do not create new types themselves. Generics, on the other hand, allow for the creation of new, parameterized types.
In order to provide support for generics, Dart has a separate syntax using <T>
and similar constructs, which allows for the creation of new types based on generic parameters. While typedefs
could potentially be used in some cases where generics would be useful, they do not provide the full functionality and type safety of generic types.