Comments are the way to explain code using simple text which cannot be readable by programming language compiler. We have seen comments in many programming languages and used by millions of programmers to make programming easier for himself and other programmers. For every programmer beginner or pro it is must to learn about comments. So in this tutorial we would learn about Flutter Dart Add Single Line Multiple Line Comments Syntax Android iOS Android Studio Visual Studio Code Example Tutorial.
Contents in this project Flutter Dart Add Single Line Multiple Line Comments Syntax Android iOS Android Studio Visual Studio Code Example:
1. Using Double Forward Slash ( // ) :- The First method to add comment in Flutter Dart is commenting single line only. So to make single line as comment we would use Double forward Slash at the beginning of that particular line.
// This is Single Line Comment.
// double number = 12345 ;
var hello = 'hello' ; // This is also comment example after variable creation.
2. Using Forward Sign with Asterisk Sign ( /* * / ) :- This is another method to add comments in dart flutter. Using forward slash and Asterisk sign we can comment multiple lines together in flutter dart. In below code the complete Container widget along with Raised Button widget will be written as comment.
margin: const EdgeInsets.fromLTRB(20, 0, 20, 0),
onPressed: () => callStaticMember(),
child: Text(' Click Here To Call Static Variable '),
padding: EdgeInsets.fromLTRB(12, 12, 12, 12),