Implementing Generics and Typedefs

As we’ve mentioned several times throughout this book, Dart is an optional-typed language, which means that you are not required to specify variables’ data types in your applications. However, data typing can be very useful for self-documenting your source code and can make your life easier if you have to maintain the application.

If you indicate data types in your applications, something amazing will happen—all the Dart tools will begin to work for you and will provide various alerts while you work. These alerts might indicate typing errors between the parameters of a function or between a function ...

Get Web Programming with Dart now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.