Comments in Dart

Haider Ali
Complete Flutter Guide
Apr 7, 2024

Lesson#5

Comments are used to document code inside the program. Comments increases readibility (although some coders don’t agree).

There are single-line and multi-line comments in Dart. Single line comments starts with // and multi-line comments are enclosed in /* and */.

Example:

/* 
Multi-line comment
This program prints the message "Hello World!" on screen.
*/
void main() {
print("Hello World!");
// this is a single line comment
}
comments

--

--