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. 👌
Typedefs are particularly useful for functions with many arguments or complex types with generics. 👍
Found this useful? Show some love and share the original tweet 🙏
Previous | Next |
---|---|
Use type annotations for safer code | Functions as arguments (with tear-off) |