Dart Comments
Syntax
• // Single-line comment
• /* Multi-line/In-line comment */
• /// Dartdoc comment
Examples
End of Line Comment
Everything to the right of // in the same line is commented.
int i = 0; // Commented out text
Multi-Line Comment
Everything between /* and */ is commented.
void main() {
for (int i = 0; i < 5; i++) {
/* This is commented, and
will not affect code */
print('hello ${i + 1}');
}
}