Skip to content

How to define type aliases in Dart

In Dart, you can use a “typedef” to define type aliases for your function and non-function types.

They make your code more concise, so you can avoid repeating long type names. 👌

Particularly useful useful for long function arguments or complex types with generics. 👍

Previous Next
Use type annotations for safer code Functions as arguments (with tear-off)

Last update: 18 septembre 2023
Created: 18 septembre 2023