Use type annotations for safer code¶
The Dart analyzer can infer types for fields, methods, variables, and more.
But sometimes it needs a little help and you can use type annotations to ensure variables are of the intended type.
This way, your code won’t compile if you use types incorrectly.
Previous | Next |
---|---|
Const vs final vs var | How to define type aliases in Dart |
Last update:
18 septembre 2023
Created: 18 septembre 2023
Created: 18 septembre 2023