Monday, July 18, 2022

Flutter: Comments

¿What are the comments? We can say that are code snippets that will be ignored by the application and will not execute. They help us to leave notes to guide ourselves or other developers through the code.

In this article, we will see three types of comments:

  • One-line comments start with \\
  • Multiple line comments start with \* and end with *\
  • Documentation comments start with \\\

In the next code snippet, we can see the usage of each one. When we run the code, we can see the comments do not have any effect on the printed result:

In the next image we can see the usage of the TODO tag. We can see the comment in the information section. Some IDE’s like Android Studio and Visual Studio have support for the TODO tag:

Documentation comments will be shown in the documentation section of our IDE. Check the next image:

0 comments:

Post a Comment

Entradas populares